@Override public Optional<EyeLocationData> fill(DataContainer container, EyeLocationData eyeLocationData) { if (container.contains(Keys.EYE_HEIGHT.getQuery())) { return Optional.of( eyeLocationData.set( Keys.EYE_HEIGHT, DataUtil.getData(container, Keys.EYE_HEIGHT, Double.class))); } else if (container.contains(Keys.EYE_LOCATION.getQuery())) { return Optional.of( eyeLocationData.set( Keys.EYE_LOCATION, DataUtil.getData(container, Keys.EYE_LOCATION, Vector3d.class))); } return Optional.absent(); }
@Override public Optional<EyeLocationData> fill( DataHolder dataHolder, EyeLocationData manipulator, MergeFunction overlap) { if (supports(dataHolder)) { final EyeLocationData merged = overlap.merge(manipulator.copy(), from(dataHolder).get()); return Optional.of(manipulator.set(Keys.EYE_HEIGHT, merged.eyeHeight().get())); } return Optional.absent(); }