Skip to main content
1-Visitor
June 19, 2017
Question

Identify attribute type

  • June 19, 2017
  • 1 reply
  • 2095 views

I have list of attributes which might be String, Double, Boolean or List values. I would like to identify what type of attribute is it based on the name of the attribute. Could anyone help me how to get to know the type of attribute?

1 reply

16-Pearl
June 20, 2017

Hi Austin Nabors-Keating‌,

Use AttributeTypeSummary API to get this Data types for attribute defined on any object type.

PersistableAdapter obj = new PersistableAdapter(cr, null , Locale.US,null);

      /* load attribute */

      obj.load("GROUP_EFFECTIVITY");

      Object enumValue = obj.get("GROUP_EFFECTIVITY");

      System.out.println("IBA Value :: " + enumValue);

AttributeTypeSummary ats = obj.getAttributeDescriptor("GROUP_EFFECTIVITY");

      System.out.println("Display Name :: " + ats.getLabel());

System.out.println("Data Type :: " + ats.getDataType());

      System.out.println("Description :: " + ats.getDescription());

Output will looks like below:

output.png

Regards,

Shirish