org.pojomatic.annotations
Enum PojomaticPolicy

java.lang.Object
  extended by java.lang.Enum<PojomaticPolicy>
      extended by org.pojomatic.annotations.PojomaticPolicy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<PojomaticPolicy>

public enum PojomaticPolicy
extends java.lang.Enum<PojomaticPolicy>

A policy for defining which sets of Pojomatic operations (equals, hashCode and toString) should use a property. This is set using Property.

See Also:
DefaultPojomaticPolicy

Enum Constant Summary
ALL
          Use the property for hashCode, equals and toString.
DEFAULT
          Use the default policy specified via the @AutoProperty annotation, or ALL if none was specified.
EQUALS
          Use the property for equals only.
EQUALS_TO_STRING
          Use the property for both equals and toString.
HASHCODE_EQUALS
          Use the property for both hashCode and equals.
NONE
          Do not use the property for any of hashCode, equals or toString.
TO_STRING
          Use the property for both toString only.
 
Method Summary
 java.util.Set<PropertyRole> getRoles()
           
static PojomaticPolicy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static PojomaticPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

HASHCODE_EQUALS

public static final PojomaticPolicy HASHCODE_EQUALS
Use the property for both hashCode and equals. Anything included in public int hashCode() should also be included in public boolean equals(Object) to preserve the general contract of Object.hashCode().

See Also:
Object.hashCode(), Object.equals(Object)

EQUALS_TO_STRING

public static final PojomaticPolicy EQUALS_TO_STRING
Use the property for both equals and toString.

See Also:
Object.equals(Object), Object.toString()

EQUALS

public static final PojomaticPolicy EQUALS
Use the property for equals only.

See Also:
Object.equals(Object)

TO_STRING

public static final PojomaticPolicy TO_STRING
Use the property for both toString only.

See Also:
Object.toString()

ALL

public static final PojomaticPolicy ALL
Use the property for hashCode, equals and toString.


NONE

public static final PojomaticPolicy NONE
Do not use the property for any of hashCode, equals or toString.


DEFAULT

public static final PojomaticPolicy DEFAULT
Use the default policy specified via the @AutoProperty annotation, or ALL if none was specified.

Method Detail

values

public static PojomaticPolicy[] 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 (PojomaticPolicy c : PojomaticPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PojomaticPolicy valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getRoles

public java.util.Set<PropertyRole> getRoles()
Returns:
the roles this specified by this policy. Will be null for DEFAULT.


Copyright © 2008-2009. All Rights Reserved.