org.pojomatic.annotations
Enum DefaultPojomaticPolicy

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

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

A policy for defining which sets of Pojomatic operations (equals, hashCode and toString) should use all properties by default. This is set class-wide using AutoProperty.

See Also:
PojomaticPolicy

Enum Constant Summary
ALL
          Use all properties for hashCode, equals and toString by default.
EQUALS
          Use all properties for equals only by default.
EQUALS_TO_STRING
          Use all properties for both equals and toString by default.
HASHCODE_EQUALS
          Use all properties for both hashCode and equals by default.
NONE
          Do not use any properties for any of hashCode, equals or toString by default.
TO_STRING
          Use all properties for both toString only by default.
 
Method Summary
 java.util.Set<PropertyRole> getRoles()
           
static DefaultPojomaticPolicy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DefaultPojomaticPolicy[] 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 DefaultPojomaticPolicy HASHCODE_EQUALS
Use all properties for both hashCode and equals by default. 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

public static final DefaultPojomaticPolicy EQUALS
Use all properties for equals only by default.

See Also:
Object.equals(Object)

EQUALS_TO_STRING

public static final DefaultPojomaticPolicy EQUALS_TO_STRING
Use all properties for both equals and toString by default.

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

TO_STRING

public static final DefaultPojomaticPolicy TO_STRING
Use all properties for both toString only by default.

See Also:
Object.toString()

ALL

public static final DefaultPojomaticPolicy ALL
Use all properties for hashCode, equals and toString by default.


NONE

public static final DefaultPojomaticPolicy NONE
Do not use any properties for any of hashCode, equals or toString by default.

Method Detail

values

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

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

valueOf

public static DefaultPojomaticPolicy 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.


Copyright © 2008-2009. All Rights Reserved.