Package io.cui.tools.property
Enum PropertyReadWrite
- java.lang.Object
-
- java.lang.Enum<PropertyReadWrite>
-
- io.cui.tools.property.PropertyReadWrite
-
- All Implemented Interfaces:
Serializable,Comparable<PropertyReadWrite>
public enum PropertyReadWrite extends Enum<PropertyReadWrite>
Defines the read write permissions for a given property. It is defined for properties java Bean properties.- Author:
- Oliver Wolff
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NONEThe property can neither be read nor written to.READ_ONLYThe corresponding property is read only.READ_WRITEThe property can be read and written to.WRITE_ONLYThe property can only be written to.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertyReadWritefromPropertyDescriptor(PropertyDescriptor descriptor, Class<?> beanType, String propertyName)ResolvesPropertyReadWriteform the givenPropertyDescriptor.booleanisReadable()booleanisWriteable()static PropertyReadWriteresolveForBean(Class<?> beanType, String propertyName)ResolvesPropertyReadWritefor a given property withMoreReflectionstatic PropertyReadWritevalueOf(String name)Returns the enum constant of this type with the specified name.static PropertyReadWrite[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
READ_ONLY
public static final PropertyReadWrite READ_ONLY
The corresponding property is read only.
-
READ_WRITE
public static final PropertyReadWrite READ_WRITE
The property can be read and written to.
-
WRITE_ONLY
public static final PropertyReadWrite WRITE_ONLY
The property can only be written to.
-
NONE
public static final PropertyReadWrite NONE
The property can neither be read nor written to.
-
-
Method Detail
-
values
public static PropertyReadWrite[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PropertyReadWrite c : PropertyReadWrite.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PropertyReadWrite valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
resolveForBean
public static PropertyReadWrite resolveForBean(Class<?> beanType, String propertyName)
ResolvesPropertyReadWritefor a given property withMoreReflection- Parameters:
beanType- to be checked, must not be nullpropertyName- to be checked, must not be null- Returns:
- the corresponding
PropertyReadWritefor a given property
-
fromPropertyDescriptor
public static PropertyReadWrite fromPropertyDescriptor(PropertyDescriptor descriptor, Class<?> beanType, String propertyName)
ResolvesPropertyReadWriteform the givenPropertyDescriptor. If this provides unclear result it will callresolveForBean(Class, String)- Parameters:
descriptor- to be read frombeanType- to be checked, must not be nullpropertyName- to be checked, must not be null- Returns:
- the corresponding
PropertyReadWritefor a given property
-
isReadable
public boolean isReadable()
-
isWriteable
public boolean isWriteable()
-
-