@Test public void testThereIsParent() { DiscreteResource resource = Resources.discrete(D1, P1, VLAN1).resource(); DiscreteResource parent = Resources.discrete(D1, P1).resource(); assertThat(resource.parent(), is(Optional.of(parent))); }
@Override public Optional<DiscreteResource> parent() { return id.parent().map(x -> Resources.discrete(x).resource()); }
DiscreteResource implements Resource { @Override public Optional<DiscreteResource> parent() { return id.parent().map(x -> Resources.discrete(x).resource()); } }
DiscreteResource implements Resource { @Override public Optional<DiscreteResource> parent() { return id.parent().map(x -> Resources.discrete(x).resource()); } DiscreteResource(DiscreteResourceId id);   DiscreteResource(); }
DiscreteResource implements Resource { @Override public Optional<DiscreteResource> parent() { return id.parent().map(x -> Resources.discrete(x).resource()); } DiscreteResource(DiscreteResourceId id);   DiscreteResource(); @Override DiscreteResourceId id(); @Override String simpleTypeName(); @Override boolean isTypeOf(Class<?> type); @Override boolean isSubTypeOf(Class<?> ancestor); @Override Optional<T> valueAs(Class<T> type); @Override DiscreteResource child(Object child); @Override ContinuousResource child(Class<?> child, double value); @Override Optional<DiscreteResource> parent(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
DiscreteResource implements Resource { @Override public Optional<DiscreteResource> parent() { return id.parent().map(x -> Resources.discrete(x).resource()); } DiscreteResource(DiscreteResourceId id);   DiscreteResource(); @Override DiscreteResourceId id(); @Override String simpleTypeName(); @Override boolean isTypeOf(Class<?> type); @Override boolean isSubTypeOf(Class<?> ancestor); @Override Optional<T> valueAs(Class<T> type); @Override DiscreteResource child(Object child); @Override ContinuousResource child(Class<?> child, double value); @Override Optional<DiscreteResource> parent(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }