use of org.apache.atlas.typesystem.types.AttributeInfo in project incubator-atlas by apache.
the class StructInstance method getLong.
public long getLong(String attrName) throws AtlasException {
AttributeInfo i = fieldMapping.fields.get(attrName);
if (i == null) {
throw new AtlasException(String.format("Unknown field %s for Struct %s", attrName, getTypeName()));
}
if (i.dataType() != DataTypes.LONG_TYPE) {
throw new AtlasException(String.format("Field %s for Struct %s is not a %s, call generic get method", attrName, getTypeName(), DataTypes.LONG_TYPE.getName()));
}
int pos = fieldMapping.fieldPos.get(attrName);
int nullPos = fieldMapping.fieldNullPos.get(attrName);
if (nullFlags[nullPos]) {
return DataTypes.LONG_TYPE.nullValue();
}
return longs[pos];
}
use of org.apache.atlas.typesystem.types.AttributeInfo in project incubator-atlas by apache.
the class StructInstance method getBigInt.
public BigInteger getBigInt(String attrName) throws AtlasException {
AttributeInfo i = fieldMapping.fields.get(attrName);
if (i == null) {
throw new AtlasException(String.format("Unknown field %s for Struct %s", attrName, getTypeName()));
}
if (i.dataType() != DataTypes.BIGINTEGER_TYPE) {
throw new AtlasException(String.format("Field %s for Struct %s is not a %s, call generic get method", attrName, getTypeName(), DataTypes.BIGINTEGER_TYPE.getName()));
}
int pos = fieldMapping.fieldPos.get(attrName);
int nullPos = fieldMapping.fieldNullPos.get(attrName);
if (nullFlags[nullPos]) {
return DataTypes.BIGINTEGER_TYPE.nullValue();
}
return bigIntegers[pos];
}
Aggregations