* invalid
*/
protected Optional<Sone> getSone(SimpleFieldSet simpleFieldSet, String parameterName, boolean localOnly, boolean mandatory) throws FcpException {
String soneId = simpleFieldSet.get(parameterName);
if (mandatory && (soneId == null)) {
throw new FcpException("Could not load Sone ID from “" + parameterName + "”.");
}
Optional<Sone> sone = core.getSone(soneId);
if ((mandatory && !sone.isPresent()) || (mandatory && sone.isPresent() && (localOnly && !sone.get().isLocal()))) {
throw new FcpException("Could not load Sone from “" + soneId + "”.");
}
return sone;
}