Class EitherTypeAdapter.PropertyChecker

  • All Implemented Interfaces:
    java.util.function.Predicate<com.google.gson.JsonElement>
    Enclosing class:
    EitherTypeAdapter<L,​R>

    public static class EitherTypeAdapter.PropertyChecker
    extends java.lang.Object
    implements java.util.function.Predicate<com.google.gson.JsonElement>
    A predicate that is useful for checking alternatives in case both the left and the right type are JSON object types.
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyChecker​(java.lang.String propertyName)  
      PropertyChecker​(java.lang.String propertyName, java.lang.Class<? extends com.google.gson.JsonElement> expectedType)  
      PropertyChecker​(java.lang.String propertyName, java.lang.String expectedValue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean test​(com.google.gson.JsonElement element)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Constructor Detail

      • PropertyChecker

        public PropertyChecker​(java.lang.String propertyName)
      • PropertyChecker

        public PropertyChecker​(java.lang.String propertyName,
                               java.lang.String expectedValue)
      • PropertyChecker

        public PropertyChecker​(java.lang.String propertyName,
                               java.lang.Class<? extends com.google.gson.JsonElement> expectedType)
    • Method Detail

      • test

        public boolean test​(com.google.gson.JsonElement element)
        Specified by:
        test in interface java.util.function.Predicate<com.google.gson.JsonElement>