@Override public UriBuilder path(String segment) throws IllegalArgumentException { if (segment == null) throw new IllegalArgumentException(Messages.MESSAGES.pathNull()); path = paths(true, path, segment); return this; }
@SuppressWarnings("unchecked") @Override public UriBuilder path(Class resource) throws IllegalArgumentException { if (resource == null) throw new IllegalArgumentException(Messages.MESSAGES.pathNull()); Path ann = (Path) resource.getAnnotation(Path.class); if (ann != null) { String[] segments = new String[]{ann.value()}; path = paths(true, path, segments); } else { throw new IllegalArgumentException(Messages.MESSAGES.classMustBeAnnotatedWithPath()); } return this; }
@Override public UriBuilder path(Method method) throws IllegalArgumentException { if (method == null) { throw new IllegalArgumentException(Messages.MESSAGES.methodNull()); } Path ann = method.getAnnotation(Path.class); if (ann != null) { path = paths(true, path, ann.value()); } else { throw new IllegalArgumentException(Messages.MESSAGES.methodNotAnnotatedWithPath()); } return this; }
@Override public UriBuilder path(String segment) throws IllegalArgumentException { if (segment == null) throw new IllegalArgumentException(Messages.MESSAGES.pathNull()); path = paths(true, path, segment); return this; }
@SuppressWarnings("unchecked") @Override public UriBuilder path(Class resource) throws IllegalArgumentException { if (resource == null) throw new IllegalArgumentException(Messages.MESSAGES.pathNull()); Path ann = (Path) resource.getAnnotation(Path.class); if (ann != null) { String[] segments = new String[]{ann.value()}; path = paths(true, path, segments); } else { throw new IllegalArgumentException(Messages.MESSAGES.classMustBeAnnotatedWithPath()); } return this; }
@Override public UriBuilder path(Method method) throws IllegalArgumentException { if (method == null) { throw new IllegalArgumentException(Messages.MESSAGES.methodNull()); } Path ann = method.getAnnotation(Path.class); if (ann != null) { path = paths(true, path, ann.value()); } else { throw new IllegalArgumentException(Messages.MESSAGES.methodNotAnnotatedWithPath()); } return this; }