@Override public boolean accepts(Object o) { if (o instanceof SBase) { SBase sbase = (SBase) o; if (sbase.isSetId() && (id != null) && sbase.getId().equals(id)) { return true; } if (sbase.isSetName() && (name != null) && sbase.getName().equals(name)) { return true; } } return false; }
/** * @param nsb * @return preferably the name if is set otherwise the id or an empty * {@link String} if both is undefined. */ public static final String getNameOrId(SBase nsb) { if (nsb.isSetName()) { return nsb.getName(); } else if (nsb.isSetId()) { return nsb.getId(); } return ""; }
/** * @param nsb * @return preferably the id if it is set, otherwise the name or an empty * {@link String} if both is undefined. */ public static final String getIdOrName(SBase nsb) { if (nsb.isSetId()) { return nsb.getId(); } else if (nsb.isSetName()) { return nsb.getId(); } return ""; }
name = sb.isSetName() ? new String(sb.getName()) : null;