- java.lang.Object
-
- org.joda.beans.impl.BasicBean
-
- All Implemented Interfaces:
Bean
public abstract class BasicBean extends java.lang.Object implements Bean
Basic implementation ofBean
intended for applications to subclass.The subclass must to provide an implementation for
Bean.metaBean()
. This returns the complete definition of the bean at the meta level.
-
-
Constructor Summary
Constructors Constructor Description BasicBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasicBean
clone()
Clones this bean, returning an independent copy.boolean
equals(java.lang.Object obj)
Checks if this bean equals another.int
hashCode()
Returns a suitable hash code.java.lang.String
toString()
Returns a string that summarises the bean.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.joda.beans.Bean
metaBean, property, propertyNames
-
-
-
-
Method Detail
-
clone
public BasicBean clone()
Clones this bean, returning an independent copy.- Overrides:
clone
in classjava.lang.Object
- Returns:
- the clone, not null
-
equals
public boolean equals(java.lang.Object obj)
Checks if this bean equals another.This compares the class and all the properties of the bean.
- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to compare to, null returns false- Returns:
- true if the beans are equal
-
hashCode
public int hashCode()
Returns a suitable hash code.The hash code is derived from all the properties of the bean.
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a suitable hash code
-
toString
public java.lang.String toString()
Returns a string that summarises the bean.The string contains the class name and properties.
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a summary string, not null
-
-