@Override public Option copy() { try { return (Option) SerializeUtils.copyObject(this); } catch (Exception e) { throw new RuntimeException("Object copy failed.", e); } }
/** * Gets a materialized object of this option. * * @return the materialized object */ public Object materializeObject() { if ((this.currentValue == null) || this.requiredType.isInstance(this.currentValue)) { return this.currentValue; } else if (this.currentValue instanceof File) { File inputFile = (File) this.currentValue; Object result = null; try { result = SerializeUtils.readFromFile(inputFile); } catch (Exception ex) { throw new RuntimeException("Problem loading " + this.requiredType.getName() + " object from file '" + inputFile.getName() + "':\n" + ex.getMessage(), ex); } return result; } else { throw new RuntimeException( "Could not materialize object of required type " + this.requiredType.getName() + ", found " + this.currentValue.getClass().getName() + " instead."); } }
Object result = null; try { result = SerializeUtils.readFromFile(inputFile); } catch (Exception ex) { throw new RuntimeException("Problem loading "
Object result = null; try { result = SerializeUtils.readFromFile(inputFile); } catch (Exception ex) { throw new RuntimeException("Problem loading "
@Override public Option copy() { try { return (Option) SerializeUtils.copyObject(this); } catch (Exception e) { throw new RuntimeException("Object copy failed.", e); } }
Object result = null; try { result = SerializeUtils.readFromFile(inputFile); } catch (Exception ex) { throw new RuntimeException("Problem loading "
Object result = null; try { result = SerializeUtils.readFromFile(inputFile); } catch (Exception ex) { throw new RuntimeException("Problem loading "
Object result = null; try { result = SerializeUtils.readFromFile(inputFile); } catch (Exception ex) { throw new RuntimeException("Problem loading "
Object result = null; try { result = SerializeUtils.readFromFile(inputFile); } catch (Exception ex) { throw new RuntimeException("Problem loading "