@Test public void testTypeOf() { DiscreteResource discrete = Resources.discrete(D1, P1, VLAN1).resource(); assertThat(discrete.isTypeOf(DeviceId.class), is(false)); assertThat(discrete.isTypeOf(PortNumber.class), is(false)); assertThat(discrete.isTypeOf(VlanId.class), is(true)); }
@Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); }
DiscreteResource implements Resource { @Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } }
DiscreteResource implements Resource { @Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } DiscreteResource(DiscreteResourceId id);   DiscreteResource(); }
DiscreteResource implements Resource { @Override public boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } 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 boolean isTypeOf(Class<?> type) { checkNotNull(type); return id.isTypeOf(type); } 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();  }