@PublicEvolving public class ClassInstance extends HierarchyDescriptor
Constructor and Description |
---|
ClassInstance() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertiesWithPrefix(String keyPrefix,
DescriptorProperties properties)
Internal method for properties conversion.
|
ClassInstance |
of(String className)
Sets the fully qualified class name for creating an instance.
|
ClassInstance |
parameter(BigDecimal value)
Adds a constructor parameter value of DECIMAL type.
|
ClassInstance |
parameter(boolean value)
Adds a constructor parameter value of BOOLEAN type.
|
ClassInstance |
parameter(byte value)
Adds a constructor parameter value of TINYINT type.
|
ClassInstance |
parameter(ClassInstance classInstance)
Adds a constructor parameter value of a class instance (i.e.
|
ClassInstance |
parameter(double value)
Adds a constructor parameter value of DOUBLE type.
|
ClassInstance |
parameter(float value)
Adds a constructor parameter value of FLOAT type.
|
ClassInstance |
parameter(int value)
Adds a constructor parameter value of INT type.
|
ClassInstance |
parameter(long value)
Adds a constructor parameter value of BIGINT type.
|
ClassInstance |
parameter(short value)
Adds a constructor parameter value of SMALLINT type.
|
ClassInstance |
parameter(String value)
Adds a constructor parameter value of VARCHAR type.
|
ClassInstance |
parameter(String typeString,
String valueString)
Adds a constructor parameter value of literal type.
|
ClassInstance |
parameter(TypeInformation<?> typeInfo,
String valueString)
Adds a constructor parameter value of literal type.
|
ClassInstance |
parameterString(String valueString)
Adds a constructor parameter value of literal type.
|
Map<String,String> |
toProperties()
Converts this descriptor into a set of properties.
|
public ClassInstance of(String className)
E.g. org.example.MyClass or org.example.MyClass$StaticInnerClass
className
- fully qualified class namepublic ClassInstance parameterString(String valueString)
Examples: - "true", "false" -> BOOLEAN - "42", "-5" -> INT - "2.0", "1234.222" -> DOUBLE - VARCHAR otherwise
For other types and explicit type declaration use parameter(String, String)
or
parameter(TypeInformation, String)
.
public ClassInstance parameter(String typeString, String valueString)
typeString
- the type string that define how to parse the given value stringvalueString
- the literal value to be parsedpublic ClassInstance parameter(TypeInformation<?> typeInfo, String valueString)
typeInfo
- the type that define how to parse the given value stringvalueString
- the literal value to be parsedpublic ClassInstance parameter(boolean value)
value
- BOOLEAN valuepublic ClassInstance parameter(double value)
value
- DOUBLE valuepublic ClassInstance parameter(float value)
value
- FLOAT valuepublic ClassInstance parameter(int value)
value
- INT valuepublic ClassInstance parameter(String value)
value
- VARCHAR valuepublic ClassInstance parameter(long value)
value
- BIGINT valuepublic ClassInstance parameter(byte value)
value
- TINYINT valuepublic ClassInstance parameter(short value)
value
- SMALLINT valuepublic ClassInstance parameter(BigDecimal value)
value
- DECIMAL valuepublic ClassInstance parameter(ClassInstance classInstance)
classInstance
- description of a class instance (i.e. a Java object with a public
constructor).public Map<String,String> toProperties()
public void addPropertiesWithPrefix(String keyPrefix, DescriptorProperties properties)
addPropertiesWithPrefix
in class HierarchyDescriptor
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.