Class LocationImpl

    • Constructor Detail

      • LocationImpl

        public LocationImpl()
    • Method Detail

      • canSet

        public final boolean canSet​(DynamicObject store,
                                    java.lang.Object value)
        Description copied from class: Location
        Returns true if the location can be set to the value.
        Overrides:
        canSet in class Location
        Parameters:
        store - the receiver object
        value - the value in question
      • canStore

        public boolean canStore​(java.lang.Object value)
        Description copied from class: Location
        Returns true if the location is compatible with the value. The value may still be rejected if Location.canSet(DynamicObject, Object) returns false.
        Overrides:
        canStore in class Location
        Parameters:
        value - the value in question
      • canStoreFinal

        protected boolean canStoreFinal​(DynamicObject store,
                                        java.lang.Object value)
      • isFinal

        public boolean isFinal()
        Description copied from class: Location
        Returns true if this is a final location, i.e. readonly once set.
        Overrides:
        isFinal in class Location
      • isConstant

        public boolean isConstant()
        Description copied from class: Location
        Returns true if this is an immutable constant location.
        Overrides:
        isConstant in class Location
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in class Location
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getWhereString

        protected java.lang.String getWhereString()
      • objectArrayCount

        public int objectArrayCount()
        Get the number of object array elements this location requires.
      • objectFieldCount

        public int objectFieldCount()
        Get the number of in-object Object fields this location requires.
      • primitiveFieldCount

        public int primitiveFieldCount()
        Get the number of in-object primitive fields this location requires.
      • primitiveArrayCount

        public int primitiveArrayCount()
        Get the number of primitive array elements this location requires.
      • valueEquals

        public static boolean valueEquals​(java.lang.Object val1,
                                          java.lang.Object val2)
        Boxed values need to be compared by value not by reference. The first parameter should be the one with the more precise type information. For sets to final locations, otherValue.equals(thisValue) seems more beneficial, since we usually know more about the value to be set.