public static enum EqualsAndHashCode.CacheStrategy extends Enum<EqualsAndHashCode.CacheStrategy>
Enum Constant and Description |
---|
LAZY
Cache the result of the first invocation of
hashCode and use it for subsequent invocations. |
NEVER
Never cache.
|
Modifier and Type | Method and Description |
---|---|
static EqualsAndHashCode.CacheStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EqualsAndHashCode.CacheStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EqualsAndHashCode.CacheStrategy NEVER
public static final EqualsAndHashCode.CacheStrategy LAZY
hashCode
and use it for subsequent invocations.
This can improve performance if all fields used for calculating the hashCode
are immutable
and thus every invocation of hashCode
will always return the same value.
Do not use this if there's any chance that different invocations of hashCode
might return different values.public static EqualsAndHashCode.CacheStrategy[] values()
for (EqualsAndHashCode.CacheStrategy c : EqualsAndHashCode.CacheStrategy.values()) System.out.println(c);
public static EqualsAndHashCode.CacheStrategy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2024. All rights reserved.