@Test public void testTypeOf() { ContinuousResource continuous = Resources.continuous(D1, P1, Bandwidth.class) .resource(BW1.bps()); assertThat(continuous.isTypeOf(DeviceId.class), is(false)); assertThat(continuous.isTypeOf(PortNumber.class), is(false)); assertThat(continuous.isTypeOf(Bandwidth.class), is(true)); }
@Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); }
ContinuousResource implements Resource { @Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } }
ContinuousResource implements Resource { @Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } ContinuousResource(ContinuousResourceId id, double value);   ContinuousResource(); }
ContinuousResource implements Resource { @Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } ContinuousResource(ContinuousResourceId id, double value);   ContinuousResource(); @Override ContinuousResourceId id(); @Override String simpleTypeName(); @Override boolean isTypeOf(Class<?> type); double value(); @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(); }
ContinuousResource implements Resource { @Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } ContinuousResource(ContinuousResourceId id, double value);   ContinuousResource(); @Override ContinuousResourceId id(); @Override String simpleTypeName(); @Override boolean isTypeOf(Class<?> type); double value(); @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();  }