- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {SimpleDateFormat s =
String pattern;new SimpleDateFormat(pattern)
String template;Locale locale;new SimpleDateFormat(template, locale)
new SimpleDateFormat()
- Smart code suggestions by Codota
}
/** * Asynchronous export by example. * * @param format export format * @param e sample * @return job id */ public String asyncExportAllByExample(FORMAT format, BusinessEntityImpl e) { WikittyQuery query = new WikittyQueryMaker().wikitty(e).end(); String result = asyncExportAllByQuery(format, query); return result; }
/** * Synchronous export by example. * * @param format export format * @param e sample * @return export string */ public String syncExportAllByExample(FORMAT format, BusinessEntityImpl e) { WikittyQuery query = new WikittyQueryMaker().wikitty(e).end(); String result = syncExportAllByQuery(format, query); return result; }
/** * Synchronous export by example. * * @param format export format * @param e sample * @return export string */ public void syncExportAllByExample(FORMAT format, BusinessEntityImpl e, Writer writer) { WikittyQuery query = new WikittyQueryMaker().wikitty(e).end(); syncExportAllByQuery(format, query, writer); }
/** * Null field are not used in search request. * * @param e sample wikitty * @return */ public <E extends BusinessEntityImpl> E findByExample(E e) { long start = TimeLog.getTime(); WikittyQuery query = new WikittyQueryMaker().wikitty(e).end(); WikittyQueryResult<E> queryResult = findAllByQuery((Class<E>)e.getClass(), Collections.singletonList(query), true).get(0); E result = queryResult.peek(); timeLog.log(start, "findByExample"); return result; }
/** * Null field are not used in search request. * * @param e sample wikitty * @param first * @param limit * @param fieldFacet * @return */ public <E extends BusinessEntityImpl> WikittyQueryResult<E> findAllByExample(E e, int first, int limit, ElementField ... fieldFacet) { long start = TimeLog.getTime(); WikittyQuery query = new WikittyQueryMaker().wikitty(e).end() .setOffset(first).setLimit(limit) .setFacetField(fieldFacet); WikittyQueryResult<E> result = findAllByQuery((Class<E>)e.getClass(), Collections.singletonList(query), false).get(0); timeLog.log(start, "findAllByExample<limit>"); return result; }
/** * @deprecated remove this undocumented method */ @Deprecated protected void assign(Wikitty wikitty, WikittyTreeNodeImpl root, String path) { String[] nodeNames = path.split("/"); WikittyTreeNodeImpl currentNode = root; outerloop : for( String nodeName : nodeNames ) { WikittyTreeNodeImpl node = new WikittyTreeNodeImpl(); node.setName(nodeName); WikittyQuery query = new WikittyQueryMaker().wikitty(node.getWikitty()).end(); List<String> wikittiesId = wikittyClient.findAllByQuery(query).getAll(); List<Wikitty> wikitties = wikittyClient.restore(wikittiesId); for ( Wikitty child : wikitties ) { if (!child.hasExtension(WikittyTreeNode.EXT_WIKITTYTREENODE)) { continue; } node = new WikittyTreeNodeImpl(child); if ( node.getName().equals(nodeName) ) { currentNode = node; continue outerloop; } } Assert.fail( "Unable to find node " + nodeName + " inside " + currentNode.getName() ); } currentNode.addAttachment(wikitty.getWikittyId()); wikittyClient.store(currentNode.getWikitty()); }
w.addExtension(MOVIE_EXTENSION); w.setField(MEDIA_EXTENSION_NAME, "type", "movie"); WikittyQuery query = new WikittyQueryMaker().wikitty(w).end(); query.addFacetField(new ElementField(MOVIE_EXTENSION_NAME,"authors")); query.addFacetField(new ElementField(MOVIE_EXTENSION_NAME,"date"));
w.addExtension(MOVIE_EXTENSION); w.setField(MOVIE_EXTENSION_NAME, "name", "The godfather"); WikittyQuery query = new WikittyQueryMaker().wikitty(w).end(); Wikitty resultFind = wikittyClient.findByQuery(Wikitty.class, query);