Class PrimitiveTypeProperties

java.lang.Object
org.apache.sis.internal.jaxb.PrimitiveTypeProperties

public final class PrimitiveTypeProperties extends Object
A workaround for attaching properties (nilreason, href, etc.) to primitive type wrappers. The normal approach in SIS is to implement the NilObject interface. However, we cannot do so when the object is a final Java class like Boolean, Integer, Double or String. This class provides a workaround using specific instances of those wrappers.
Since:
0.4
Version:
0.4
Author:
Martin Desruisseaux (Geomatys)
See Also:
  • Method Details

    • associate

      public static void associate(Object primitive, Object property)
      Associates the given property to the given primitive. The primitive argument shall be a specific instance created by the new keyword, not a shared instance link Boolean.FALSE or the values returned by Integer.valueOf(int).
      Parameters:
      primitive - the Boolean, Integer, Double or String specific instance.
      property - the NilReason or other property to associate to the given instance.
    • property

      public static Object property(Object primitive)
      Returns the property of the given primitive type, or null if none.
      Parameters:
      primitive - the Boolean, Integer, Double or String specific instance.
      Returns:
      the property associated to the given instance, or null if none.