@Test public void testMatch2() throws Exception { ServiceType st1 = new ServiceType("service:jmx:rmi"); ServiceType st2 = new ServiceType("service:jmx"); assert !st1.matches(st2); assert st2.matches(st1); st1 = new ServiceType("jmx:rmi"); st2 = new ServiceType("jmx"); assert !st1.matches(st2); assert st2.matches(st1); }
public boolean matches(ServiceType serviceType) { if (serviceType == null) return false; if (equals(serviceType)) return true; if (isAbstractType()) { if (serviceType.isAbstractType()) { if (!getPrincipleTypeName().equals(serviceType.getPrincipleTypeName())) return false; return getConcreteTypeName().equals(serviceType.getConcreteTypeName()); } else { return false; } } else { if (serviceType.isAbstractType()) { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } else { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } } }
ServiceType implements Comparable<ServiceType> { public boolean matches(ServiceType serviceType) { if (serviceType == null) return false; if (equals(serviceType)) return true; if (isAbstractType()) { if (serviceType.isAbstractType()) { if (!getPrincipleTypeName().equals(serviceType.getPrincipleTypeName())) return false; return getConcreteTypeName().equals(serviceType.getConcreteTypeName()); } else { return false; } } else { if (serviceType.isAbstractType()) { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } else { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } } } }
ServiceType implements Comparable<ServiceType> { public boolean matches(ServiceType serviceType) { if (serviceType == null) return false; if (equals(serviceType)) return true; if (isAbstractType()) { if (serviceType.isAbstractType()) { if (!getPrincipleTypeName().equals(serviceType.getPrincipleTypeName())) return false; return getConcreteTypeName().equals(serviceType.getConcreteTypeName()); } else { return false; } } else { if (serviceType.isAbstractType()) { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } else { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } } } ServiceType(String type); }
ServiceType implements Comparable<ServiceType> { public boolean matches(ServiceType serviceType) { if (serviceType == null) return false; if (equals(serviceType)) return true; if (isAbstractType()) { if (serviceType.isAbstractType()) { if (!getPrincipleTypeName().equals(serviceType.getPrincipleTypeName())) return false; return getConcreteTypeName().equals(serviceType.getConcreteTypeName()); } else { return false; } } else { if (serviceType.isAbstractType()) { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } else { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } } } ServiceType(String type); boolean isServiceURL(); boolean isAbstractType(); boolean isDefaultNamingAuthority(); String getConcreteTypeName(); String getPrincipleTypeName(); String getAbstractTypeName(); String getNamingAuthority(); boolean matches(ServiceType serviceType); int compareTo(ServiceType that); boolean equals(Object obj); int hashCode(); String asString(); @Override String toString(); }
ServiceType implements Comparable<ServiceType> { public boolean matches(ServiceType serviceType) { if (serviceType == null) return false; if (equals(serviceType)) return true; if (isAbstractType()) { if (serviceType.isAbstractType()) { if (!getPrincipleTypeName().equals(serviceType.getPrincipleTypeName())) return false; return getConcreteTypeName().equals(serviceType.getConcreteTypeName()); } else { return false; } } else { if (serviceType.isAbstractType()) { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } else { return getPrincipleTypeName().equals(serviceType.getPrincipleTypeName()); } } } ServiceType(String type); boolean isServiceURL(); boolean isAbstractType(); boolean isDefaultNamingAuthority(); String getConcreteTypeName(); String getPrincipleTypeName(); String getAbstractTypeName(); String getNamingAuthority(); boolean matches(ServiceType serviceType); int compareTo(ServiceType that); boolean equals(Object obj); int hashCode(); String asString(); @Override String toString(); static final String ANY_NAMING_AUTHORITY; static final String DEFAULT_NAMING_AUTHORITY; }