Class PdfValue
-
- All Implemented Interfaces:
public final class PdfValue
This represents a value stored inside a PDF document stream. The PDF has a few different data types of values that are reasonably interchangeable. The type can be retrieved with getType and can be one of PdfValueType.
When creating a new value, the type will be automatically set depending on the constructor parameter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
PdfValue.PdfValueType
Type of a value stored in the PDF document stream.
-
Field Summary
Fields Modifier and Type Field Description public final PdfValue.PdfValueType
type
-
Constructor Summary
Constructors Constructor Description PdfValue(long longValue)
Creates a new PDF value of INTEGER type. PdfValue(double doubleValue)
Creates a new PDF value of DOUBLE type. PdfValue(boolean booleanValue)
Creates a new PDF value of BOOLEAN type. PdfValue(String stringValue)
Creates a new PDF value of STRING type. PdfValue(List<PdfValue> listValue)
Creates a new PDF value of ARRAY type. PdfValue(Map<String, PdfValue> mapValue)
Creates a new PDF value of DICTIONARY type. PdfValue()
Creates a new PDF value of NULLOBJ type.
-
Method Summary
Modifier and Type Method Description PdfValue.PdfValueType
getType()
Gets the type of this PdfValue, which is one of PdfValueType. long
getLong()
Gets the stored Long value or 0 if the value isn't an integer. double
getDouble()
Gets the stored Double value or 0.0 if the value isn't a double. boolean
getBoolean()
Gets the stored Boolean value or false if the value isn't a boolean. String
getString()
Gets the stored String value or null if the value isn't a string. List<PdfValue>
getArray()
Gets the stored List of PdfValues or null if the value isn't an array. Map<String, PdfValue>
getDictionary()
Gets the stored Map of String and PdfValues, or null if the value isn't a dictionary. String
toString()
-
-
Constructor Detail
-
PdfValue
PdfValue(long longValue)
Creates a new PDF value of INTEGER type.
-
PdfValue
PdfValue(double doubleValue)
Creates a new PDF value of DOUBLE type.
-
PdfValue
PdfValue(boolean booleanValue)
Creates a new PDF value of BOOLEAN type.
-
PdfValue
PdfValue(Map<String, PdfValue> mapValue)
Creates a new PDF value of DICTIONARY type.
-
PdfValue
PdfValue()
Creates a new PDF value of NULLOBJ type.
-
-
Method Detail
-
getType
@NonNull() PdfValue.PdfValueType getType()
Gets the type of this PdfValue, which is one of PdfValueType.
- Returns:
Type of this value, one of PdfValueType.
-
getLong
long getLong()
Gets the stored Long value or 0 if the value isn't an integer.
- Returns:
Stored integer value or 0 if the value isn't an integer.
-
getDouble
double getDouble()
Gets the stored Double value or 0.0 if the value isn't a double.
- Returns:
Stored double value or 0.0 if the value isn't a double.
-
getBoolean
boolean getBoolean()
Gets the stored Boolean value or false if the value isn't a boolean.
- Returns:
Stored boolean value or false if the value isn't a boolean.
-
getString
String getString()
Gets the stored String value or null if the value isn't a string.
- Returns:
Stored string value or null if the value isn't a string.
-
getDictionary
Map<String, PdfValue> getDictionary()
- Returns:
Stored map or null if the value isn't a dictionary.
-
-
-
-