/** * Converts the specified object to a member of the enumeration. * * @param value * object to convert * @return enumeration member * @throws NullPointerException * if value is {@code null} * @throws IllegalArgumentException * if object cannot be matched to a member of the enumeration */ public static ActivityStatus valueOf(Object value) { if (value == null) { throw new NullPointerException("object must be non-null"); } if (value instanceof Number) { return valueOf(((Number) value).intValue()); } else if (value instanceof String) { return valueOf(value.toString()); } throw new IllegalArgumentException( "Cannot convert object of type '" + value.getClass().getName() + "' enum ActivityStatus"); } }
/** * {@inheritDoc} */ @Override public String toString() { OpType sType = getType(); ActivityStatus Status = getStatus(); UsecTimestamp sTime = getStartTime(); UsecTimestamp eTime = getEndTime(); StringBuilder str = new StringBuilder(); str.append(getClass().getSimpleName()).append("{") .append("Name:").append(getName()).append(",") .append("ParentId:").append(parentId != null? parentId: "root").append(",") .append("TrackId:").append(getTrackingId()).append(",") .append("Status:").append(Status == null ? "null" : Status.toString()).append(",") .append("Type:").append(sType == null ? "null" : sType.toString()).append(",") .append("PID:").append(getPID()).append(",") .append("TID:").append(getTID()).append(",") .append("ElapsedUsec:").append(getElapsedTimeUsec()).append(",") .append("WallUsec:").append(getWallTimeUsec()).append(",") .append("FQName:").append(getSource().getFQName()).append(",") .append("IdCount=").append(getIdCount()).append(",") .append("SnapCount=").append(getSnapshotCount()).append(",") .append("StartTime:[").append(sTime.toString()).append("],") .append("EndTime:[").append(eTime.toString()).append("]}"); return str.toString(); }
status = ActivityStatus.valueOf(attValue); } else if (attName.equals(SIM_XML_ATTR_SEVERITY)) { sev = getLevel(attValue);