public class TwitterTextConfiguration
extends java.lang.Object
TwitterTextParser
to parse a tweet.Modifier and Type | Class and Description |
---|---|
static class |
TwitterTextConfiguration.TwitterTextWeightedRange |
Constructor and Description |
---|
TwitterTextConfiguration() |
Modifier and Type | Method and Description |
---|---|
static TwitterTextConfiguration |
configurationFromJson(java.lang.String json,
boolean isResource)
Create a
TwitterTextConfiguration object from JSON
The JSON can have the following properties
version (required, integer, min value 0)
maxWeightedTweetLength (required, integer, min value 0)
scale (required, integer, min value 1)
defaultWeight (required, integer, min value 0)
transformedURLLength (integer, min value 0)
ranges (array of range items)
A range item has the following properties:
start (required, integer, min value 0)
end (required, integer, min value 0)
weight (required, integer, min value 0) |
boolean |
equals(java.lang.Object o) |
int |
getDefaultWeight()
Get the default weight.
|
boolean |
getEmojiParsingEnabled()
Get whether emoji parsing is enabled.
|
int |
getMaxWeightedTweetLength()
Get the maximum weighted length in the config.
|
java.util.List<TwitterTextConfiguration.TwitterTextWeightedRange> |
getRanges()
Get an array of range items that describe ranges of Unicode code points and the weight to
apply to each code point.
|
int |
getScale()
Get the scale.
|
int |
getTransformedURLLength()
In previous versions of twitter-text, which was the "shortened URL length."
Differentiating between the http and https shortened length for URLs has been deprecated
(https is used for all t.co URLs).
|
int |
getVersion()
Get the current version.
|
int |
hashCode() |
public static TwitterTextConfiguration configurationFromJson(java.lang.String json, boolean isResource)
TwitterTextConfiguration
object from JSON
The JSON can have the following properties
version (required, integer, min value 0)
maxWeightedTweetLength (required, integer, min value 0)
scale (required, integer, min value 1)
defaultWeight (required, integer, min value 0)
transformedURLLength (integer, min value 0)
ranges (array of range items)
A range item has the following properties:
start (required, integer, min value 0)
end (required, integer, min value 0)
weight (required, integer, min value 0)json
- The configuration string or file name in the config directoryisResource
- boolean indicating if the json refers to a file name for the configuration.TwitterTextConfiguration
object that provides all the configuration values.public int getVersion()
public int getMaxWeightedTweetLength()
maxWeightedTweetLength
of 140
and a defaultWeight
of 1 for all code points.public int getScale()
public int getDefaultWeight()
public boolean getEmojiParsingEnabled()
public int getTransformedURLLength()
public java.util.List<TwitterTextConfiguration.TwitterTextWeightedRange> getRanges()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object