Class Datatype<V extends Value>

    • Field Detail

      • AUTHZFORCE_EXTENSION_PREFIX

        public static final String AUTHZFORCE_EXTENSION_PREFIX
        Prefix used by AuthZForce non-standard datatypes (PDP extensions). Third-party (outside AuthZForce project) contributions must use a different prefix to avoid conflicts.
        See Also:
        Constant Field Values
    • Method Detail

      • getId

        public final String getId()
        Get ID (URI) of this datatype
        Returns:
        datatype ID
      • getFunctionIdPrefix

        public final String getFunctionIdPrefix()
        Gets prefix of ID of any standard generic (e.g. bag/set) function built on this datatype, e.g. 'urn:oasis:names:tc:xacml:1.0:function:string' for string datatype
        Returns:
        ID prefix for functions of this datatype
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • getTypeParameter

        public abstract Optional<? extends Datatype<?>> getTypeParameter()
        Return type parameter e.g. the bag element datatype (datatype of every element in a bag of this datatype); null if this is a primitive type (no sub-elements)
        Returns:
        datatype parameter, null for primitive datatypes
      • isInstance

        public abstract boolean isInstance​(Value val)
        This method returns true if the specified value argument is an instance of the represented datatype; it returns false otherwise
        Parameters:
        val - value to be checked
        Returns:
        true iff val is an instance of this datatype
      • cast

        public abstract V cast​(Value val)
                        throws ClassCastException
        Casts a value to the class or interface represented by this datatype.
        Parameters:
        val - value to be cast
        Returns:
        the value after casting, or null if val is null
        Throws:
        ClassCastException - if the value is not null and is not assignable to the type V.
      • newArray

        public abstract V[] newArray​(int length)
        Creates a new array with this as component type
        Parameters:
        length - length of the new array
        Returns:
        the new array