public static NdConstantEnum create(NdTypeSignature enumType, String enumValue) { NdConstantEnum result = new NdConstantEnum(enumType.getNd()); result.setEnumType(enumType); result.setEnumValue(enumValue); return result; }
public void setEnumType(NdTypeSignature enumType) { ENUM_TYPE.put(getNd(), this.address, enumType); }
private static Object unpackValue(NdConstant value) { if (value == null) { return null; } if (value instanceof NdConstantAnnotation) { NdConstantAnnotation annotation = (NdConstantAnnotation) value; return createBinaryAnnotation(annotation.getValue()); } if (value instanceof NdConstantArray) { NdConstantArray array = (NdConstantArray) value; List<NdConstant> arrayContents = array.getValue(); Object[] result = new Object[arrayContents.size()]; for (int idx = 0; idx < arrayContents.size(); idx++) { result[idx] = unpackValue(arrayContents.get(idx)); } return result; } if (value instanceof NdConstantEnum) { NdConstantEnum ndConstantEnum = (NdConstantEnum) value; NdTypeSignature signature = ndConstantEnum.getType(); return new EnumConstantSignature(signature.getRawType().getBinaryName(), ndConstantEnum.getValue()); } if (value instanceof NdConstantClass) { NdConstantClass constant = (NdConstantClass) value; return new ClassSignature(constant.getValue().getRawType().getBinaryName()); } return value.getConstant(); }
EnumConstantSignature signature = (EnumConstantSignature) value; NdConstantEnum result = NdConstantEnum.create(createTypeIdFromBinaryName(signature.getTypeName()), new String(signature.getEnumConstantName()));
private static Object unpackValue(NdConstant value) { if (value == null) { return null; } if (value instanceof NdConstantAnnotation) { NdConstantAnnotation annotation = (NdConstantAnnotation) value; return createBinaryAnnotation(annotation.getValue()); } if (value instanceof NdConstantArray) { NdConstantArray array = (NdConstantArray) value; List<NdConstant> arrayContents = array.getValue(); Object[] result = new Object[arrayContents.size()]; for (int idx = 0; idx < arrayContents.size(); idx++) { result[idx] = unpackValue(arrayContents.get(idx)); } return result; } if (value instanceof NdConstantEnum) { NdConstantEnum ndConstantEnum = (NdConstantEnum) value; NdTypeSignature signature = ndConstantEnum.getType(); return new EnumConstantSignature(signature.getRawType().getBinaryName(), ndConstantEnum.getValue()); } if (value instanceof NdConstantClass) { NdConstantClass constant = (NdConstantClass) value; return new ClassSignature(constant.getValue().getRawType().getBinaryName()); } return value.getConstant(); }
EnumConstantSignature signature = (EnumConstantSignature) value; NdConstantEnum result = NdConstantEnum.create(createTypeIdFromBinaryName(signature.getTypeName()), new String(signature.getEnumConstantName()));
public static NdConstantEnum create(NdTypeSignature enumType, String enumValue) { NdConstantEnum result = new NdConstantEnum(enumType.getNd()); result.setEnumType(enumType); result.setEnumValue(enumValue); return result; }
public void setEnumValue(String enumType) { ENUM_VALUE.put(getNd(), this.address, enumType); }
public NdTypeSignature getType() { return ENUM_TYPE.get(getNd(), this.address); }
public void setEnumValue(String enumType) { ENUM_VALUE.put(getNd(), this.address, enumType); }
public void setEnumType(NdTypeSignature enumType) { ENUM_TYPE.put(getNd(), this.address, enumType); }
public NdTypeSignature getType() { return ENUM_TYPE.get(getNd(), this.address); }
public char[] getValue() { return ENUM_VALUE.get(getNd(), this.address).getChars(); }
public char[] getValue() { return ENUM_VALUE.get(getNd(), this.address).getChars(); }