@Override public OptionSet getOptionSetByCode( String code ) { return optionSetStore.getByCode( code ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> T getByCode( Class<T> clazz, String code ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return null; } return (T) store.getByCode( code ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getByCode( Class<T> clazz, Collection<String> codes ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getByCode( codes ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getObjects( Class<T> clazz, IdentifiableProperty property, Collection<String> identifiers ) { IdentifiableObjectStore<T> store = (IdentifiableObjectStore<T>) getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } if ( identifiers != null && !identifiers.isEmpty() ) { if ( property == null || IdentifiableProperty.UID.equals( property ) ) { return store.getByUid( identifiers ); } else if ( IdentifiableProperty.CODE.equals( property ) ) { return store.getByCode( identifiers ); } else if ( IdentifiableProperty.NAME.equals( property ) ) { return store.getByName( identifiers ); } throw new InvalidIdentifierReferenceException( "Invalid identifiable property / class combination: " + property ); } return new ArrayList<>(); }
return store.getByCode( value );