com.gisgraphy.domain.valueobject
Class Output

java.lang.Object
  extended by com.gisgraphy.domain.valueobject.Output

public class Output
extends java.lang.Object

Represent an output specification.

Author:
David Masclet
See Also:
DSL

Nested Class Summary
static class Output.OutputFormat
          All the possible fulltext search output format, all the OUTPUFORMAT enum should be in uppercase
static class Output.OutputStyle
          All the possible fulltext search output style verbosity Short (basic informations) : feature_id, name, fully_qualified_name, zipcode (if city), placetype, country_code, country_name
Medium (More informations) : Short + lat, lon, feature_class, feature_code, population, fips
Long (AlternateNames +adm informations) : Medium + alternateNames, adm1_name, adm2_name, adm3_name, Adm4_name, adm1_code, Adm2_code, Adm3_code, Adm4_code
Full (alternatenames for adm and country): Long + country_alternate_name_, adm1_alternate_name_, adm2_alternate_name_
 
Field Summary
static java.lang.String DEFAULT_LANGUAGE_CODE
          The Default languageCode
static Output DEFAULT_OUTPUT
          Output with default values
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getFields()
           
 Output.OutputFormat getFormat()
           
 java.lang.String getLanguageCode()
           
 Output.OutputStyle getStyle()
           
 int hashCode()
           
 boolean isIndented()
           
 java.lang.String toString()
           
static Output withDefaultFormat()
           
static Output withFormat(Output.OutputFormat format)
           
 Output withIndentation()
          This method force the output to be indented
 Output withLanguageCode(java.lang.String languageCode)
           
 Output withStyle(Output.OutputStyle style)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LANGUAGE_CODE

public static final java.lang.String DEFAULT_LANGUAGE_CODE
The Default languageCode


DEFAULT_OUTPUT

public static final Output DEFAULT_OUTPUT
Output with default values

Method Detail

withFormat

public static Output withFormat(Output.OutputFormat format)
Parameters:
format - The format the output shoud have
Returns:
an output specification with the specified format

withDefaultFormat

public static Output withDefaultFormat()
Returns:
an output specification with default output format
See Also:
Output.OutputFormat.getDefault()

getFields

public java.lang.String getFields()
Returns:
the list of fields that will be returned in the output according to the getLanguageCode() and Output.OutputStyle (the fields return by the full text search engine)

getFormat

public Output.OutputFormat getFormat()
Returns:
the format, default is Output.OutputFormat.getDefault()
See Also:
withFormat(com.gisgraphy.domain.valueobject.Output.OutputFormat)

getLanguageCode

public java.lang.String getLanguageCode()
Returns:
the iso639 Alpha2 LanguageCode, default is DEFAULT_LANGUAGE_CODE
See Also:
withLanguageCode(String)

getStyle

public Output.OutputStyle getStyle()
Returns:
the style, default is Output.OutputStyle.getDefault()
See Also:
withStyle(com.gisgraphy.domain.valueobject.Output.OutputStyle)

isIndented

public boolean isIndented()
Returns:
wether the output must be indent, default to false
See Also:
withIndentation()

withIndentation

public Output withIndentation()
This method force the output to be indented

Returns:
the current Object instance in order to chain methods
See Also:
DSL

withLanguageCode

public Output withLanguageCode(java.lang.String languageCode)
Parameters:
languageCode - The iso639Alpha2 LanguageCode parameter that the output format should be, the fulltext results will be in the specified language The language code can be null or a non existing language code (no check is done).if the specified languageCode is null or an empty string, it will be set to null
Returns:
the current Object instance in order to chain methods
See Also:
DSL

withStyle

public Output withStyle(Output.OutputStyle style)
Parameters:
style - The verbosity style parameter that the output format should have, the output will include more or less data according to the specified style
Returns:
the current Object instance in order to chain methods
See Also:
DSL

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010. All Rights Reserved.