private Name convert(ServiceName serviceName) { String[] c = serviceName.toArray(); CompositeName name = new CompositeName(); int baseIndex = serviceNameBase.toArray().length; for (int i = baseIndex; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
private Name suffix(ServiceName parent, ServiceName child) { String[] p = parent.toArray(); String[] c = child.toArray(); CompositeName name = new CompositeName(); for (int i = p.length; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); final List<NameClassPair> results = new ArrayList<NameClassPair>(); for (ServiceName child : children) { final String[] childParts = child.toArray(); if (childParts.length > lookupParts.length + 1) { childContexts.add(childParts[lookupParts.length]);
final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); final List<Binding> results = new ArrayList<Binding>(); for (ServiceName child : children) { final String[] childParts = child.toArray(); if (childParts.length > lookupParts.length + 1) { childContexts.add(childParts[lookupParts.length]);
private String[] toArray(final int len) { final String[] result; if (parent == null) { result = new String[len]; } else { result = parent.toArray(len + 1); } result[result.length - len] = name; return result; } }
/** * Convert this service name into an array of strings containing the segments of the name. If this array * is passed into {@link #of(String...)} it will yield a {@code ServiceName} which is equal to this one. * * @return the string array */ public String[] toArray() { return toArray(1); }
private String[] toArray(final int len) { final String[] result; if (parent == null) { result = new String[len]; } else { result = parent.toArray(len + 1); } result[result.length - len] = name; return result; } }
/** * Convert this service name into an array of strings containing the segments of the name. If this array * is passed into {@link #of(String...)} it will yield a {@code ServiceName} which is equal to this one. * * @return the string array */ public String[] toArray() { return toArray(1); }
/** * Attempt to match a service name. * * @param serviceName the service name * @return the value result, or {@code null} if no match was found */ public V match(ServiceName serviceName) { return match(serviceName.toArray(), 0, root); }
private Name convert(ServiceName serviceName) { String[] c = serviceName.toArray(); CompositeName name = new CompositeName(); int baseIndex = serviceNameBase.toArray().length; for (int i = baseIndex; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
/** * Attempt to match a service name. * * @param serviceName the service name * @return the value result, or {@code null} if no match was found */ public V match(ServiceName serviceName) { return match(serviceName.toArray(), 0, root); }
private Name suffix(ServiceName parent, ServiceName child) { String[] p = parent.toArray(); String[] c = child.toArray(); CompositeName name = new CompositeName(); for (int i = p.length; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
private Name suffix(ServiceName parent, ServiceName child) { String[] p = parent.toArray(); String[] c = child.toArray(); CompositeName name = new CompositeName(); for (int i = p.length; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
private Name convert(ServiceName serviceName) { String[] c = serviceName.toArray(); CompositeName name = new CompositeName(); int baseIndex = serviceNameBase.toArray().length; for (int i = baseIndex; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
private Name convert(ServiceName serviceName) { String[] c = serviceName.toArray(); CompositeName name = new CompositeName(); int baseIndex = serviceNameBase.toArray().length; for (int i = baseIndex; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
private Name suffix(ServiceName parent, ServiceName child) { String[] p = parent.toArray(); String[] c = child.toArray(); CompositeName name = new CompositeName(); for (int i = p.length; i < c.length; i++) { try { name.add(c[i]); } catch (InvalidNameException e) { throw new IllegalStateException(e); } } return name; }
final String[] parts = serviceName.toArray();
final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); final List<Binding> results = new ArrayList<Binding>(); for (ServiceName child : children) { final String[] childParts = child.toArray(); if (childParts.length > lookupParts.length + 1) { childContexts.add(childParts[lookupParts.length]);
final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); final List<Binding> results = new ArrayList<Binding>(); for (ServiceName child : children) { final String[] childParts = child.toArray(); if (childParts.length > lookupParts.length + 1) { childContexts.add(childParts[lookupParts.length]);
final String[] lookupParts = lookupName.toArray(); final Set<String> childContexts = new HashSet<String>(); final List<Binding> results = new ArrayList<Binding>(); for (ServiceName child : children) { final String[] childParts = child.toArray(); if (childParts.length > lookupParts.length + 1) { childContexts.add(childParts[lookupParts.length]);