Package smile.data.type
Record Class Property
java.lang.Object
java.lang.Record
smile.data.type.Property
- Record Components:
name
- the property name.type
- the class type.accessor
- the read accessor.field
- the struct field.
public record Property(String name, Class<?> type, Method accessor, StructField field)
extends Record
A component in record or a property in a Java Bean class.
-
Constructor Summary
ConstructorDescriptionProperty
(String name, Class<?> type, Method accessor, StructField field) Creates an instance of aProperty
record class. -
Method Summary
Modifier and TypeMethodDescriptionaccessor()
Returns the value of theaccessor
record component.final boolean
Indicates whether some other object is "equal to" this one.field()
Returns the value of thefield
record component.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.static Property
of
(PropertyDescriptor prop) Returns the property for a bean property.static Property[]
Returns the properties of record or bean class.static Property
of
(RecordComponent prop) Returns the property for a record component.final String
toString()
Returns a string representation of this record class.Class
<?> type()
Returns the value of thetype
record component.
-
Constructor Details
-
Method Details
-
of
Returns the property for a record component.- Parameters:
prop
- a record component.- Returns:
- the property for a record component.
-
of
Returns the property for a bean property.- Parameters:
prop
- a property descriptor.- Returns:
- the property for a bean property.
-
of
Returns the properties of record or bean class.- Parameters:
clazz
- The class type.- Returns:
- the properties.
- Throws:
IntrospectionException
- if an exception occurs during introspection.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
accessor
Returns the value of theaccessor
record component.- Returns:
- the value of the
accessor
record component
-
field
Returns the value of thefield
record component.- Returns:
- the value of the
field
record component
-