Class BagDatatype<AV extends AttributeValue>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.value.Datatype<Bag<AV>>
-
- org.ow2.authzforce.core.pdp.api.value.BagDatatype<AV>
-
- Type Parameters:
AV
- Java type implementing this datatype (instance type)
public class BagDatatype<AV extends AttributeValue> extends Datatype<Bag<AV>>
Bag datatype for bags of primitive datatypes
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.value.Datatype
AUTHZFORCE_EXTENSION_PREFIX
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bag<AV>
cast(Value val)
Casts a value to the class or interface represented by this datatype.Datatype<AV>
getElementType()
Returns the bag element datatype (datatype of every element in a bag of this datatype).Optional<? extends Datatype<?>>
getTypeParameter()
Return type parameter e.g.boolean
isInstance(Value val)
This method returns true if the specified value argument is an instance of the represented datatype; it returns false otherwiseBag<AV>[]
newArray(int length)
Creates a new array with this as component type
-
-
-
Method Detail
-
isInstance
public boolean isInstance(Value val)
Description copied from class:Datatype
This method returns true if the specified value argument is an instance of the represented datatype; it returns false otherwise- Specified by:
isInstance
in classDatatype<Bag<AV extends AttributeValue>>
- Parameters:
val
- value to be checked- Returns:
- true iff
val
is an instance of this datatype
-
cast
public Bag<AV> cast(Value val) throws ClassCastException
Description copied from class:Datatype
Casts a value to the class or interface represented by this datatype.- Specified by:
cast
in classDatatype<Bag<AV extends AttributeValue>>
- 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.
-
getTypeParameter
public Optional<? extends Datatype<?>> getTypeParameter()
Description copied from class:Datatype
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)- Specified by:
getTypeParameter
in classDatatype<Bag<AV extends AttributeValue>>
- Returns:
- datatype parameter, null for primitive datatypes
-
newArray
public Bag<AV>[] newArray(int length)
Description copied from class:Datatype
Creates a new array with this as component type- Specified by:
newArray
in classDatatype<Bag<AV extends AttributeValue>>
- Parameters:
length
- length of the new array- Returns:
- the new array
-
getElementType
public Datatype<AV> getElementType()
Returns the bag element datatype (datatype of every element in a bag of this datatype). Same asgetTypeParameter()
.- Returns:
- bag element datatype
-
-