Class Chain


  • public abstract class Chain
    extends Object
    A chain of references, which starts at a root object and leads to a particular value (either an object or a primitive).
    • Method Detail

      • hasParent

        public boolean hasParent()
        Returns whether this chain has a parent. This returns false only when this chain represents the root object itself.
      • getValue

        @Nullable
        public Object getValue()
        Returns the value that this chain leads to. If the value is a primitive, a wrapper object is returned instead.
      • getValueType

        @Nonnull
        public abstract Class<?> getValueType()
      • isThroughField

        public boolean isThroughField()
        Returns whether the connection of the parent chain and this chain is through a field (of the getParent().getValue().getClass() class).
      • isThroughArrayIndex

        public boolean isThroughArrayIndex()
        Returns whether the connection of the parent chain and this chain is through an array index, i.e. the parent leads to an array, and this chain leads to an element of that array.
      • isPrimitive

        public boolean isPrimitive()
        Returns whether the value of this chain represents a primitive.
      • getRoot

        @Nonnull
        public Object getRoot()
        Returns the root object of this chain.