public enum PropertyStyle extends Enum<PropertyStyle>
A property may be read-only, read-write or write-only. This enumeration models those options.
It is strongly recommended to use the methods, not compare against the enum values.
| Enum Constant and Description |
|---|
DERIVED
The property is derived.
|
IMMUTABLE
The property is immutable.
|
READ_ONLY
The property is read-only.
|
READ_ONLY_BUILDABLE
The property is read-only but can be written via the builder.
|
READ_WRITE
The property can be read and written.
|
WRITE_ONLY
The property is write-only.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isBuildable()
Checks whether the property can be used in the builder.
|
boolean |
isDerived()
Checks whether the property is derived.
|
boolean |
isReadable()
Checks whether the property is readable.
|
boolean |
isReadOnly()
Checks whether the property is read-only.
|
boolean |
isSerializable()
Checks whether the property can be serialized in a round-trip.
|
boolean |
isWritable()
Checks whether the property is writable.
|
static PropertyStyle |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PropertyStyle[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PropertyStyle READ_WRITE
public static final PropertyStyle READ_ONLY
public static final PropertyStyle WRITE_ONLY
public static final PropertyStyle READ_ONLY_BUILDABLE
public static final PropertyStyle DERIVED
public static final PropertyStyle IMMUTABLE
public static PropertyStyle[] values()
for (PropertyStyle c : PropertyStyle.values()) System.out.println(c);
public static PropertyStyle valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isReadable()
This checks if the property get method will succeed.
public boolean isWritable()
This checks if the property set method will succeed.
public boolean isReadOnly()
This checks if the property get method will succeed and the set method fail. Read-only, derived and immutable properties will return true. Note that an immutable property can be written via the builder.
public boolean isBuildable()
To check for round-trip behavior, use isSerializable().
public boolean isDerived()
A derived property has no instance variable.
public boolean isSerializable()
A property that is read-write or immutable can be round-trip serialized.
Copyright © 2007–2017 Joda.org. All rights reserved.