public static String getStateAttribute(DigitalObject obj) throws ObjectIntegrityException {

            if (obj.getState() == null || obj.getState().isEmpty()) {
                return MODEL.ACTIVE.localName;
            } else {
                switch (obj.getState().charAt(0)) {
                    case 'D':
                        return MODEL.DELETED.localName;
                    case 'I':
                        return MODEL.INACTIVE.localName;
                    case 'A':
                        return MODEL.ACTIVE.localName;
                    default:
                        throw new ObjectIntegrityException("Could not determine "
                                                   + "state attribute from '"
                                                   + obj.getState() + "'");
                }
            }
    }
public static String getStateAttribute ( DigitalObject obj ) throws ObjectIntegrityException { if ( obj . getState ( ) == null || obj . getState ( ) . isEmpty ( ) ) { return MODEL . ACTIVE . localName ; } else { switch ( obj . getState ( ) . charAt ( 0 ) ) { case 'D' : return MODEL . DELETED . localName ; case 'I' : return MODEL . INACTIVE . localName ; case 'A' : return MODEL . ACTIVE . localName ; default : throw new ObjectIntegrityException ( "Could not determine " + "state attribute from '" + obj . getState ( ) + "'" ) ; } } }
Reads the state attribute from a DigitalObject.
<p>
Null or empty strings are interpteted as "Active".
</p>
@param obj Object that potentially contains object state data.
@return String containing full state value (Active, Inactive, or Deleted)
@throws ObjectIntegrityException thrown when the state cannot be parsed.