public class FunctionalClassProperty<Type,TargetType> extends java.lang.Object implements ClassProperty<Type,TargetType>
| Constructor and Description |
|---|
FunctionalClassProperty(ClassPropertyKey key,
java.lang.Class<Type> type,
Visibility visibility,
java.util.function.Function<TargetType,Type> getter) |
FunctionalClassProperty(ClassPropertyKey key,
java.lang.Class<Type> type,
Visibility visibility,
java.util.function.Function<TargetType,Type> getter,
java.util.function.BiConsumer<TargetType,Type> setter) |
FunctionalClassProperty(ClassPropertyKey key,
java.lang.Class<Type> type,
Visibility visibility,
java.util.function.Function<TargetType,Type> getter,
java.util.function.BiConsumer<TargetType,Type> setter,
boolean _static) |
| Modifier and Type | Method and Description |
|---|---|
java.util.function.Function<TargetType,Type> |
getGetter() |
ClassPropertyKey |
getKey() |
java.util.function.BiConsumer<TargetType,Type> |
getSetter() |
java.lang.Class<Type> |
getType() |
Type |
getValue(TargetType target)
If
ClassProperty.isStatic() returns true - specified target is ignored and may be null |
Visibility |
getVisibility() |
boolean |
isMutable()
Returns
false is no setter function was specified for this property. |
boolean |
isStatic() |
static <TargetType,Type> |
newPublic(ClassPropertyKey key,
java.lang.Class<Type> type,
java.util.function.Function<TargetType,Type> getter) |
static <TargetType,Type> |
newPublic(ClassPropertyKey key,
java.lang.Class<Type> type,
java.util.function.Function<TargetType,Type> getter,
java.util.function.BiConsumer<TargetType,Type> setter) |
static <TargetType,Type> |
newPublic(ClassPropertyKey key,
java.lang.Class<Type> type,
java.util.function.Function<TargetType,Type> getter,
java.util.function.BiConsumer<TargetType,Type> setter,
boolean _static) |
void |
setValue(TargetType target,
Type value)
throws UnsupportedOperationException if
isMutable() returns false. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGenericTypepublic FunctionalClassProperty(ClassPropertyKey key, java.lang.Class<Type> type, Visibility visibility, java.util.function.Function<TargetType,Type> getter)
public FunctionalClassProperty(ClassPropertyKey key, java.lang.Class<Type> type, Visibility visibility, java.util.function.Function<TargetType,Type> getter, java.util.function.BiConsumer<TargetType,Type> setter)
public FunctionalClassProperty(ClassPropertyKey key, java.lang.Class<Type> type, Visibility visibility, java.util.function.Function<TargetType,Type> getter, java.util.function.BiConsumer<TargetType,Type> setter, boolean _static)
public ClassPropertyKey getKey()
getKey in interface ClassProperty<Type,TargetType>public java.lang.Class<Type> getType()
getType in interface ClassProperty<Type,TargetType>public Visibility getVisibility()
getVisibility in interface ClassProperty<Type,TargetType>public boolean isStatic()
isStatic in interface ClassProperty<Type,TargetType>public java.util.function.Function<TargetType,Type> getGetter()
public java.util.function.BiConsumer<TargetType,Type> getSetter()
public Type getValue(TargetType target) throws java.lang.Exception
ClassPropertyClassProperty.isStatic() returns true - specified target is ignored and may be nullgetValue in interface ClassProperty<Type,TargetType>java.lang.IllegalArgumentException - if target is not an instance of the declaring class from the property keyjava.lang.Exceptionpublic void setValue(TargetType target, Type value) throws java.lang.Exception
isMutable() returns false.setValue in interface ClassProperty<Type,TargetType>java.lang.UnsupportedOperationException - if ClassProperty.isMutable() returns falsejava.lang.IllegalArgumentException - if target is not an instance of the declaring class from the property keyjava.lang.Exceptionpublic boolean isMutable()
false is no setter function was specified for this property.isMutable in interface ClassProperty<Type,TargetType>public static <TargetType,Type> FunctionalClassProperty<Type,TargetType> newPublic(ClassPropertyKey key, java.lang.Class<Type> type, java.util.function.Function<TargetType,Type> getter)
public static <TargetType,Type> FunctionalClassProperty<Type,TargetType> newPublic(ClassPropertyKey key, java.lang.Class<Type> type, java.util.function.Function<TargetType,Type> getter, java.util.function.BiConsumer<TargetType,Type> setter)
public static <TargetType,Type> FunctionalClassProperty<Type,TargetType> newPublic(ClassPropertyKey key, java.lang.Class<Type> type, java.util.function.Function<TargetType,Type> getter, java.util.function.BiConsumer<TargetType,Type> setter, boolean _static)