public class StructImpl extends AnnotatableNode implements Struct
Struct
.annotationMap
Modifier and Type | Method and Description |
---|---|
void |
addNativeData(String key,
Object data)
Add native data to the struct.
|
String |
getAnnotationEntryKey() |
List<Annotation> |
getAnnotationList(String pkgPath,
String name)
This method will return the list of annotations for the given package path and annotation name.
|
Value[] |
getArrayField(String fieldName)
Returns value of an array field.
|
boolean |
getBooleanField(String fieldName)
Returns value of a boolean field.
|
org.ballerinalang.connector.impl.StructImpl.StructFieldImpl[] |
getFields()
Returns all the struct fields.
|
double |
getFloatField(String fieldName)
Returns value of a float field.
|
long |
getIntField(String fieldName)
Returns value of an int field.
|
Map<String,Value> |
getMapField(String fieldName)
Returns value of a map field.
|
String |
getName()
Returns the struct name.
|
Object |
getNativeData(String key)
Get native data.
|
String |
getPackage()
Returns the package of the struct.
|
Value |
getRefField(String fieldName)
Returns value of an Ref field.
|
String |
getStringField(String fieldName)
Returns value of a string field.
|
Struct |
getStructField(String fieldName)
Returns value of a struct field.
|
Value |
getTypeField(String fieldName)
Returns value of an Type field.
|
BValue |
getVMValue()
returns VM value.
|
addAnnotation
public String getPackage()
Struct
getPackage
in interface Struct
public org.ballerinalang.connector.impl.StructImpl.StructFieldImpl[] getFields()
Struct
public long getIntField(String fieldName)
Struct
getIntField
in interface Struct
fieldName
- given field namepublic double getFloatField(String fieldName)
Struct
getFloatField
in interface Struct
fieldName
- given field namepublic String getStringField(String fieldName)
Struct
getStringField
in interface Struct
fieldName
- given field namepublic boolean getBooleanField(String fieldName)
Struct
getBooleanField
in interface Struct
fieldName
- given field namepublic Struct getStructField(String fieldName)
Struct
getStructField
in interface Struct
fieldName
- given field namepublic Value[] getArrayField(String fieldName)
Struct
getArrayField
in interface Struct
fieldName
- given field namepublic BValue getVMValue()
Struct
getVMValue
in interface Struct
public Map<String,Value> getMapField(String fieldName)
Struct
getMapField
in interface Struct
fieldName
- given field namepublic Value getTypeField(String fieldName)
Struct
getTypeField
in interface Struct
fieldName
- given field namepublic Value getRefField(String fieldName)
Struct
getRefField
in interface Struct
fieldName
- given field namepublic List<Annotation> getAnnotationList(String pkgPath, String name)
Struct
getAnnotationList
in interface Struct
pkgPath
- of the annotation.name
- of the annotation.public void addNativeData(String key, Object data)
Struct
addNativeData
in interface Struct
key
- key to identify native value.data
- value to be added.public Object getNativeData(String key)
Struct
getNativeData
in interface Struct
key
- key to identify native value.public String getAnnotationEntryKey()
getAnnotationEntryKey
in class AnnotatableNode
Copyright © 2018 WSO2. All rights reserved.