Package org.bedework.timezones.common.db
Class LocalizedString
java.lang.Object
org.bedework.timezones.common.db.TzDbentity<LocalizedString>
org.bedework.timezones.common.db.LocalizedString
- All Implemented Interfaces:
Serializable,Comparable<LocalizedString>
.
- Version:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorLocalizedString(String lang, String value) Create a string by specifying all its fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck this is properly trimmedclone()Make visibleintcompareTo(LocalizedString that) protected static LocalizedStringfindLang(String lang, Collection<? extends LocalizedString> c) Search the collection for a string that matches the given language code.getLang()Get the langgetValue()Get the valueinthashCode()voidSet the langvoidSet the valueprotected voidtoStringSegment(org.bedework.util.misc.ToString ts) Add our stuff to the ToString builderbooleanupdate(LocalizedString from) Figure out what's different and update it.
-
Constructor Details
-
LocalizedString
public LocalizedString()Constructor -
LocalizedString
Create a string by specifying all its fields- Parameters:
lang- String language codevalue- String value
-
-
Method Details
-
setLang
Set the lang- Parameters:
val- String lang
-
getLang
Get the lang- Returns:
- String lang
-
setValue
Set the value- Parameters:
val- String value
-
getValue
Get the value- Returns:
- String value
-
findLang
Search the collection for a string that matches the given language code.- Parameters:
lang-c-- Returns:
- LocalizedString or null if no strings.
-
update
Figure out what's different and update it. This should reduce the number of spurious changes to the db.- Parameters:
from-- Returns:
- true if we changed something.
-
checkNulls
public boolean checkNulls()Check this is properly trimmed- Returns:
- boolean true if changed
-
compareTo
- Specified by:
compareToin interfaceComparable<LocalizedString>- Overrides:
compareToin classTzDbentity<LocalizedString>
-
hashCode
public int hashCode()- Overrides:
hashCodein classTzDbentity<LocalizedString>
-
toStringSegment
protected void toStringSegment(org.bedework.util.misc.ToString ts) Description copied from class:TzDbentityAdd our stuff to the ToString builder- Overrides:
toStringSegmentin classTzDbentity<LocalizedString>- Parameters:
ts- for result
-
clone
Description copied from class:TzDbentityMake visible- Overrides:
clonein classTzDbentity<LocalizedString>- Returns:
- Object of class T
-