This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Eng
committed
Nov 1, 2013
1 parent
411847b
commit 47334a1
Showing
6 changed files
with
523 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
zanata-war/src/main/java/org/zanata/action/SortingType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.zanata.action; | ||
|
||
import java.io.Serializable; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a> | ||
*/ | ||
@EqualsAndHashCode(of = { "displayString" }) | ||
public class SortingType implements Serializable { | ||
|
||
public static final SortingType PERCENTAGE = new SortingType("%"); | ||
|
||
public static final SortingType HOURS = new SortingType("hours"); | ||
|
||
public static final SortingType WORDS = new SortingType("words"); | ||
|
||
public static final SortingType ALPHABETICAL = new SortingType( | ||
"alphabetical"); | ||
|
||
@Getter | ||
private String displayString; | ||
|
||
@Getter | ||
@Setter | ||
private boolean descending = true; | ||
|
||
@Getter | ||
@Setter | ||
private boolean active = false; | ||
|
||
public SortingType(SortingType sortingType) { | ||
this.displayString = sortingType.displayString; | ||
this.descending = sortingType.descending; | ||
} | ||
|
||
private SortingType(String displayString) { | ||
this.displayString = displayString; | ||
} | ||
|
||
public static SortingType getPercentageType() { | ||
return new SortingType(PERCENTAGE); | ||
} | ||
|
||
public static SortingType getHoursType() { | ||
return new SortingType(HOURS); | ||
} | ||
|
||
public static SortingType getWordsType() { | ||
return new SortingType(WORDS); | ||
} | ||
|
||
public static SortingType getAlphabeticalType() { | ||
return new SortingType(ALPHABETICAL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.