public static <A> Function<A, Boolean> not(Function<A, Boolean> f) { return not.o(f); }
/** * Return the content of the response as a string if its status code equals one of the given statuses. Throw an * exception on an unexpected status. * <p> * Function composition of {@link #getContentFn} and {@link #expect(int...)}. */ public static Function<HttpResponse, String> getContentOn(final int... status) { return getContentFn.o(expect(status)); }
/** Create an object. */ public static Obj obj(Prop... ps) { return new Obj(mlist(ps).filter(notZero.o(getVal)).value()); }
@Override public void endElement(String uri, String localName, String name) throws SAXException { super.endElement(uri, localName, name); if ("Type".equals(name)) { type = getContent(); return; } else if ("Description".equals(name)) { description = getContent(); return; } if ("Extensions".equals(name)) { extensions = getContent(); return; } else if ("MimeType".equals(name)) { String[] t = type.split("/"); MimeType mimeType = mimeType(t[0].trim(), t[1].trim(), mlist(extensions.split(",")).bind(Options.<String> asList().o(Strings.trimToNone)).value(), Collections.<MimeType> nil(), option(description), none(""), none("")); registry.add(mimeType); } }