object UsStates
Reference data for the 50 US states, used to make STATE obfuscation format aware.
A STATE chunk can reach the obfuscator either spelled out ("New York") or abbreviated ("NY"). The fake pools are kept in two resources that mirror each other:
/faker/location/state/en.txtholds the spelled out names/faker/location/state/abbreviation_en.txtholds the two letter abbreviations
This object only provides the lookups needed to decide which pool to use and to convert between the two formats. The conversion is required by the geographic consistency path because Addresses.state is always stored as a two letter abbreviation.
- Alphabetic
- By Inheritance
- UsStates
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isAbbreviationFormat(value: String): Boolean
Whether the value looks like a two letter state abbreviation, for example "NY", "ny" or " Oh ".
Whether the value looks like a two letter state abbreviation, for example "NY", "ny" or " Oh ".
The check is deliberately format based rather than membership based: a two letter STATE chunk must be replaced by a two letter fake even when it is not one of the 50 official abbreviations, otherwise the obfuscated output would leak the fact that the original was not a real state.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
matches(abbreviation: String, value: String): Boolean
Whether
valuerefers to the state identified byabbreviation, in either format.Whether
valuerefers to the state identified byabbreviation, in either format.Used to match a STATE chunk against Addresses.state, which is always abbreviated, so that both "NY" and "New York" match the address whose state is "NY".
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toAbbreviation(name: String): Option[String]
The abbreviation for a spelled out state name, when the name is a known US state.
-
def
toFullName(abbreviation: String): Option[String]
The spelled out name for an abbreviation, when the abbreviation is a known US state.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()