
net.sf.jagg.msd.Discriminable Maven / Gradle / Ivy
Show all versions of jagg-core Show documentation
package net.sf.jagg.msd;
import java.util.List;
/**
* A Discriminable
object knows which properties in itself to
* be discriminated.
*
* @author Randy Gettman
* @since 0.5.0
*/
public interface Discriminable
{
/**
* Returns a List
of properties on which to discriminate on
* this object. Such properties must map to an actual method name on the
* object in the bean naming convention, e.g. a property of "value" maps to
* a method "getValue()" that takes no arguments. All properties must map
* to methods whose returns types are themselves Discriminable
,
* or of a Java built-in type:
*
*
* Boolean
* Character
* CharSequence
(all implementing classes such as
* String
, CharBuffer
,
* StringBuffer
, and StringBuilder
)
* Number
(includes BigDecimal
,
* BigInteger
, Byte
, Double
,
* Float
, Integer
, Long
, and
* Short
)
* - Any
Date
* - Any
Calendar
* - Any
Enum
* - Any
Collection
* - Any
List
* - Any primitive type:
boolean
, char
,
* byte
, short
, int
,
* long
, float
, double
.
* - An array of any above type.
*
*
* If a Discriminable
object is also
* Comparable
, then the properties listed here should also be
* the same properties used in compareTo
, for consistency.
* The List
of properties returned must be the same for any
* and every instance of each Discriminable
class. For this
* reason, it is recommended to return a static final List
.
*
* @return A List
of properties.
*/
public List getDiscriminableProperties();
}