Copyright© 2008-2022 Sitevision AB, all rights reserved.
SearchHit
instead when extracting values from a search result.@Deprecated public interface SearchFieldUtil
Note! SearchHit
has - as of Sitevision 3.0 - several typed getField
methods that you would typically instead of this interface when you want to get "non-String" values!
More information about field values/types
SearchHit.getBooleanField(String)
,
SearchHit.getDateField(String)
,
SearchHit.getFloatField(String)
,
SearchHit.getLongField(String)
Modifier and Type | Method and Description |
---|---|
Calendar |
dateFieldToCalendar(String aDateFieldValue)
Deprecated.
Returns the Calendar for a string field that contains a date value generated via Lucene's DateTools class.
|
Date |
dateFieldToDate(String aDateFieldValue)
Deprecated.
Returns the Date for a string field that contains a date value generated via Lucene's DateTools class.
|
Double |
doubleFieldToDouble(String aDoubleFieldValue)
Deprecated.
Returns the Double for a string field that contains a double value generated to be a sortable search value.
|
Integer |
intFieldToInt(String anIntFieldValue)
Deprecated.
Returns the Integer for a string field that contains a integer value generated via Lucene's NumberTools (i.e. long) class.
|
Locale |
localeFieldToLocale(String aLocaleFieldValue)
Deprecated.
use
LocaleUtil.getLocaleByString(String) instead |
Long |
longFieldToLong(String aLongFieldValue)
Deprecated.
Returns the Long for a string field that contains a long value generated via Lucene's NumberTools class.
|
Date dateFieldToDate(String aDateFieldValue)
aDateFieldValue
- the String
that should be converted to a Date
aDateFieldValue
as Date
, or null
if indeterminable.Calendar dateFieldToCalendar(String aDateFieldValue)
aDateFieldValue
- the String
that should be converted to a Calendar
aDateFieldValue
as Calendar
, or null
if indeterminable.Locale localeFieldToLocale(String aLocaleFieldValue)
LocaleUtil.getLocaleByString(String)
instead
A toString()
on a english american locale returns the String "en_US"
, but to create a locale
from that string you can NOT just create it by doing: new Locale("en_US")
. You must split language (en)
and country (US) since the proper way of creating the Locale is: new Locale("en", "US")
. Language must
be lowercased and country must be uppercased. This method will handle that (i.e. aLocaleFieldValue == "EN_us"
-> new Locale("en", "US")
).
Note! This method does NOT handle variants!
aLocaleFieldValue
- a String containing a language - or a language and country, separated with underscrore.aLocaleFieldValue
, returns null
if indeterminable
(e.g aLocaleFieldValue
is null
)Integer intFieldToInt(String anIntFieldValue)
anIntFieldValue
- the String
that should be converted to a Integer
anIntFieldValue
as Integer
, or null
if indeterminable.Long longFieldToLong(String aLongFieldValue)
aLongFieldValue
- the String
that should be converted to a Long
aLongFieldValue
as Long
, or null
if indeterminable.Double doubleFieldToDouble(String aDoubleFieldValue)
aDoubleFieldValue
- the String
that should be converted to a Double
aDoubleFieldValue
as Double
, or null
if indeterminable.Sitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.