@Status(stage=PRODUCTION, unitTests=PARTIAL) @Review(by="Kees Schotanus", at="2009-09-28") @Wishes(value=@Wish(value="Make this class type safe!")) public final class CodeDescription extends Object implements Serializable, Comparable<CodeDescription>
Modifier and Type | Field and Description |
---|---|
static Comparator<CodeDescription> |
caseInsensitiveDescriptionComparator
A comparator that sorts on description (case insensitive and ascending) and then code ascending.
|
static CodeDescription[] |
EMPTY_ARRAY_OF_CODE_DESCRIPTIONS
Empty array of CodeDescriptions.
|
Constructor and Description |
---|
CodeDescription(Serializable code,
String description)
Constructs a code and description pair from the supplied code and description.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CodeDescription codeDescription)
Compares this CodeDescription to the supplied codeDescription.
|
static MultiFieldComparator<CodeDescription> |
createCodeComparator()
Creates a comparator that sorts on code ascending and then description ascending.
|
static MultiFieldComparator<CodeDescription> |
createDescriptionComparator()
Creates a comparator that sorts on description ascending and then code ascending.
|
boolean |
equals(Object object)
Determines whether this CodeDescription and the supplied object are the same.
|
Serializable |
getCode()
Gets the code.
|
String |
getDescription()
Gets the description.
|
int |
hashCode()
Computes a hash code for this CodeDescription.
|
String |
toString()
Creates a String representation of this code description pair.
|
public static final CodeDescription[] EMPTY_ARRAY_OF_CODE_DESCRIPTIONS
public static final Comparator<CodeDescription> caseInsensitiveDescriptionComparator
public CodeDescription(Serializable code, String description)
code
- The code.description
- The description.NullPointerException
- When the supplied description is null.public Serializable getCode()
public String getDescription()
public int compareTo(CodeDescription codeDescription)
compareTo
in interface Comparable<CodeDescription>
codeDescription
- The CodeDescription to compare to this CodeDescription.NullPointerException
- When the supplied codeDescription is null.public boolean equals(Object object)
public int hashCode()
public static MultiFieldComparator<CodeDescription> createCodeComparator()
public static MultiFieldComparator<CodeDescription> createDescriptionComparator()
Copyright © 2008–2018. All rights reserved.