code
stringlengths
73
34.1k
label
stringclasses
1 value
Stream<String> getRessourceLines(Class<?> clazz, String filepath) { try (final BufferedReader fileReader = new BufferedReader( new InputStreamReader(clazz.getResourceAsStream(filepath), StandardCharsets.UTF_8) )) { // Collect the read lines before converting b...
java
public int count(final String word) { if (word == null) { throw new NullPointerException("the word parameter was null."); } else if (word.length() == 0) { return 0; } else if (word.length() == 1) { return 1; } final String lowerCase = word.toL...
java
public static void reset() { globalBeanBoxContext.close(); globalNextAllowAnnotation = true; globalNextAllowSpringJsrAnnotation = true; globalNextValueTranslator = new DefaultValueTranslator(); CREATE_METHOD = "create"; CONFIG_METHOD = "config"; globalBeanBoxContext = new BeanBoxContext(); }
java
public void close() { for (Entry<Object, Object> singletons : singletonCache.entrySet()) { Object key = singletons.getKey(); Object obj = singletons.getValue(); if (key instanceof BeanBox) { BeanBox box = (BeanBox) key; if (box.getPreDestroy() != null) try { box.getPreDestroy().invoke(obj)...
java
public RequestOptions addHeader(String name, String value) { if (headers == null) { headers = new CaseInsensitiveHeaders(); } headers.add(name, value); return this; }
java
public static Document parseDocument(String url) throws IOException { return Jsoup .connect(url) .timeout(Constants.PARSING_TIMEOUT) .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6") .referrer("h...
java
public static void downloadImageToFile(String url, Path file) throws IOException { if (Files.exists(file.getParent())) { URL urlObject = new URL(url); URLConnection connection = urlObject.openConnection(); connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U...
java
static String getSherdogPageUrl(Document doc) { String url = Optional.ofNullable(doc.head()) .map(h -> h.select("meta")) .map(es -> es.stream().filter(e -> e.attr("property").equalsIgnoreCase("og:url")).findFirst().orElse(null)) .map(m -> m.attr("content")) ...
java
@Override public void visitJumpInsn(final int opcode, final Label lbl) { super.visitJumpInsn(opcode, lbl); LabelNode ln = ((JumpInsnNode) instructions.getLast()).label; if (opcode == JSR && !subroutineHeads.containsKey(ln)) { subroutineHeads.put(ln, new BitSet()); } }
java
@Override public void visitEnd() { if (!subroutineHeads.isEmpty()) { markSubroutines(); if (LOGGING) { log(mainSubroutine.toString()); Iterator<BitSet> it = subroutineHeads.values().iterator(); while (it.hasNext()) { ...
java
private void emitCode() { LinkedList<Instantiation> worklist = new LinkedList<Instantiation>(); // Create an instantiation of the "root" subroutine, which is just the // main routine worklist.add(new Instantiation(null, mainSubroutine)); // Emit instantiations of each subroutine...
java
private static void getDescriptor(final StringBuffer buf, final Class<?> c) { Class<?> d = c; while (true) { if (d.isPrimitive()) { char car; if (d == Integer.TYPE) { car = 'I'; } else if (d == Void.TYPE) { ...
java
static Handler remove(Handler h, Label start, Label end) { if (h == null) { return null; } else { h.next = remove(h.next, start, end); } int hstart = h.start.position; int hend = h.end.position; int s = start.position; int e = end == null ?...
java
public void check(final int api) { if (api == Opcodes.ASM4) { if (visibleTypeAnnotations != null && visibleTypeAnnotations.size() > 0) { throw new RuntimeException(); } if (invisibleTypeAnnotations != null && invisibleTy...
java
public void accept(final ClassVisitor cv) { // visits header String[] interfaces = new String[this.interfaces.size()]; this.interfaces.toArray(interfaces); cv.visit(version, access, name, signature, superName, interfaces); // visits source if (sourceFile != null || source...
java
public void run() { this.running = true; while (this.running) { DatagramPacket packet = new DatagramPacket(this.buf, this.buf.length); try { this.socket.receive(packet); } catch (IOException ignored) { continue; } ...
java
@Override public final void startElement(final String ns, final String lName, final String qName, final Attributes list) throws SAXException { // the actual element name is either in lName or qName, depending // on whether the parser is namespace aware String name = lName == null...
java
@Override public final void endElement(final String ns, final String lName, final String qName) throws SAXException { // the actual element name is either in lName or qName, depending // on whether the parser is namespace aware String name = lName == null || lName.length() == 0 ?...
java
public AbstractInsnNode get(final int index) { if (index < 0 || index >= size) { throw new IndexOutOfBoundsException(); } if (cache == null) { cache = toArray(); } return cache[index]; }
java
public void accept(final MethodVisitor mv) { AbstractInsnNode insn = first; while (insn != null) { insn.accept(mv); insn = insn.next; } }
java
public AbstractInsnNode[] toArray() { int i = 0; AbstractInsnNode elem = first; AbstractInsnNode[] insns = new AbstractInsnNode[size]; while (elem != null) { insns[i] = elem; elem.index = i++; elem = elem.next; } return insns; }
java
public void set(final AbstractInsnNode location, final AbstractInsnNode insn) { AbstractInsnNode next = location.next; insn.next = next; if (next != null) { next.prev = insn; } else { last = insn; } AbstractInsnNode prev = location.prev; in...
java
public void add(final AbstractInsnNode insn) { ++size; if (last == null) { first = insn; last = insn; } else { last.next = insn; insn.prev = last; } last = insn; cache = null; insn.index = 0; // insn now belongs to a...
java
public void insert(final AbstractInsnNode insn) { ++size; if (first == null) { first = insn; last = insn; } else { first.prev = insn; insn.next = first; } first = insn; cache = null; insn.index = 0; // insn now belon...
java
public void insert(final InsnList insns) { if (insns.size == 0) { return; } size += insns.size; if (first == null) { first = insns.first; last = insns.last; } else { AbstractInsnNode elem = insns.last; first.prev = elem;...
java
public void insert(final AbstractInsnNode location, final AbstractInsnNode insn) { ++size; AbstractInsnNode next = location.next; if (next == null) { last = insn; } else { next.prev = insn; } location.next = insn; insn.next = ne...
java
public void insert(final AbstractInsnNode location, final InsnList insns) { if (insns.size == 0) { return; } size += insns.size; AbstractInsnNode ifirst = insns.first; AbstractInsnNode ilast = insns.last; AbstractInsnNode next = location.next; if (next...
java
public void insertBefore(final AbstractInsnNode location, final AbstractInsnNode insn) { ++size; AbstractInsnNode prev = location.prev; if (prev == null) { first = insn; } else { prev.next = insn; } location.prev = insn; insn.ne...
java
public void insertBefore(final AbstractInsnNode location, final InsnList insns) { if (insns.size == 0) { return; } size += insns.size; AbstractInsnNode ifirst = insns.first; AbstractInsnNode ilast = insns.last; AbstractInsnNode prev = location.prev...
java
public void remove(final AbstractInsnNode insn) { --size; AbstractInsnNode next = insn.next; AbstractInsnNode prev = insn.prev; if (next == null) { if (prev == null) { first = null; last = null; } else { prev.next = ...
java
void removeAll(final boolean mark) { if (mark) { AbstractInsnNode insn = first; while (insn != null) { AbstractInsnNode next = insn.next; insn.index = -1; // insn no longer belongs to an InsnList insn.prev = null; insn.next ...
java
@Override public Event parseDocument(Document doc) { Event event = new Event(); event.setSherdogUrl(ParserUtils.getSherdogPageUrl(doc)); //getting name Elements name = doc.select(".header .section_title h1 span[itemprop=\"name\"]"); event.setName(name.html().replace("<br>",...
java
private void getFights(Document doc, Event event) { logger.info("Getting fights for event #{}[{}]", event.getSherdogUrl(), event.getName()); SherdogBaseObject sEvent = new SherdogBaseObject(); sEvent.setName(event.getName()); sEvent.setSherdogUrl(event.getSherdogUrl()); List<Fi...
java
private List<Fight> parseEventFights(Elements trs, Event event) { SherdogBaseObject sEvent = new SherdogBaseObject(); sEvent.setName(event.getName()); sEvent.setSherdogUrl(event.getSherdogUrl()); List<Fight> fights = new ArrayList<>(); if (trs.size() > 0) { trs.remo...
java
private SherdogBaseObject getFighter(Element td) { Elements name1 = td.select("span[itemprop=\"name\"]"); if (name1.size() > 0) { String name = name1.get(0).html(); Elements select = td.select("a[itemprop=\"url\"]"); if (select.size() > 0) { Strin...
java
private List<Event> parseEvent(Elements trs, Organization organization) throws ParseException { List<Event> events = new ArrayList<>(); if (trs.size() > 0) { trs.remove(0); SherdogBaseObject sOrg = new SherdogBaseObject(); sOrg.setName(organization.getName()); ...
java
public void reset(String name){ if (name.equals(Names.MAIN_BRUSH.toString())) mainBrushWorkTime = 0; if (name.equals(Names.SENSOR.toString())) sensorTimeSinceCleaning = 0; if (name.equals(Names.SIDE_BRUSH.toString())) sideBrushWorkTime = 0; if (name.equals(Names.FILTER.toString())) filte...
java
@Override public void accept(final MethodVisitor mv) { switch (type) { case Opcodes.F_NEW: case Opcodes.F_FULL: mv.visitFrame(type, local.size(), asArray(local), stack.size(), asArray(stack)); break; case Opcodes.F_APPEND: mv.vi...
java
public Organization getOrganizationFromHtml(String html) throws IOException, ParseException, SherdogParserException { return new OrganizationParser(zoneId).parseFromHtml(html); }
java
public Event getEventFromHtml(String html) throws IOException, ParseException, SherdogParserException { return new EventParser(zoneId).parseFromHtml(html); }
java
public Event getEvent(String sherdogUrl) throws IOException, ParseException, SherdogParserException { return new EventParser(zoneId).parse(sherdogUrl); }
java
public Fighter getFighterFromHtml(String html) throws IOException, ParseException, SherdogParserException { return new FighterParser(pictureProcessor, zoneId).parseFromHtml(html); }
java
public Fighter getFighter(String sherdogUrl) throws IOException, ParseException, SherdogParserException { return new FighterParser(pictureProcessor, zoneId).parse(sherdogUrl); }
java
public static Object createProxyBean(Class<?> clazz, BeanBox box, BeanBoxContext ctx) { BeanBoxException.assureNotNull(clazz, "Try to create a proxy bean, but beanClass not found."); Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(clazz); if (box.getConstructorParams() != null && box.getConstructorPa...
java
public Map<Prop.Names, String> getProps(Prop.Names[] props) throws CommandExecutionException { Prop prop = new Prop(props); return prop.parseResponse(sendToArray("get_prop", prop.getRequestArray())); }
java
public String getSingleProp(Prop.Names prop) throws CommandExecutionException { Map<Prop.Names, String> value = getProps(new Prop.Names[]{prop}); String valueString = value.get(prop); if (valueString == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); ...
java
public int getIntProp(Prop.Names prop) throws CommandExecutionException { String value = getSingleProp(prop); if (value.equals("")) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); try { return Integer.valueOf(value); } catch (Exception e...
java
public boolean powerOffAfterTime(int minutes) throws CommandExecutionException { JSONArray col = new JSONArray(); col.put(0); col.put(minutes); return sendOk("cron_add", col); }
java
public static BeanBox getUniqueBeanBox(BeanBoxContext ctx, Class<?> clazz) { BeanBoxException.assureNotNull(clazz, "Target class can not be null"); BeanBox box = ctx.beanBoxMetaCache.get(clazz); if (box != null) return box; if (BeanBox.class.isAssignableFrom(clazz)) try { box = (BeanBox) clazz.newInst...
java
private static Annotation[] getAnnotations(Object targetClass) { if (targetClass instanceof Field) return ((Field) targetClass).getAnnotations(); else if (targetClass instanceof Method) return ((Method) targetClass).getAnnotations(); else if (targetClass instanceof Constructor) return ((Constructor<?>) t...
java
private static Map<String, Object> getAnnoAsMap(Object targetClass, String annoFullName) { Annotation[] anno = getAnnotations(targetClass); for (Annotation a : anno) { Class<? extends Annotation> type = a.annotationType(); if (annoFullName.equals(type.getName())) return changeAnnotationValuesToMap(a); }...
java
private static boolean checkAnnoExist(Object targetClass, Class<?> annoClass) { Annotation[] anno = getAnnotations(targetClass); for (Annotation annotation : anno) { Class<? extends Annotation> type = annotation.annotationType(); if (annoClass.equals(type)) return true; } return false; }
java
protected static BeanBox wrapParamToBox(Object param) { if (param != null) { if (param instanceof Class) return new BeanBox().setTarget(param); if (param instanceof BeanBox) return (BeanBox) param; } return new BeanBox().setAsValue(param); }
java
public static String[] addConfigurationClasses(String[] configurationClasses, AdditionalWebAppJettyConfigurationClass[] optionalAdditionalsWebappConfigurationClasses) { List<String> newConfigurationClasses = new ArrayList<>(Arrays.asList(configurationClasses)); for (AdditionalWebAppJettyConfigu...
java
public void catchException(final Label start, final Label end, final Type exception) { if (exception == null) { mv.visitTryCatchBlock(start, end, mark(), null); } else { mv.visitTryCatchBlock(start, end, mark(), exception.getInternalName()); ...
java
public static StringSwitcher create(String[] strings, int[] ints, boolean fixedInput) { Generator gen = new Generator(); gen.setStrings(strings); gen.setInts(ints); gen.setFixedInput(fixedInput); return gen.create(); }
java
public Map/*<Signature, Signature>*/resolveAll() { Map resolved = new HashMap(); for (Iterator entryIter = declToBridge.entrySet().iterator(); entryIter.hasNext(); ) { Map.Entry entry = (Map.Entry)entryIter.next(); Class owner = (Class)entry.getKey(); Set bridges = (S...
java
public void check(final int api) { if (api == Opcodes.ASM4) { if (visibleTypeAnnotations != null && visibleTypeAnnotations.size() > 0) { throw new RuntimeException(); } if (invisibleTypeAnnotations != null && invisibleTy...
java
public void accept(final ClassVisitor cv) { FieldVisitor fv = cv.visitField(access, name, desc, signature, value); if (fv == null) { return; } int i, n; n = visibleAnnotations == null ? 0 : visibleAnnotations.size(); for (i = 0; i < n; ++i) { Annot...
java
protected long computeSVUID() throws IOException { ByteArrayOutputStream bos; DataOutputStream dos = null; long svuid = 0; try { bos = new ByteArrayOutputStream(); dos = new DataOutputStream(bos); /* * 1. The class name written using UTF...
java
protected byte[] computeSHAdigest(final byte[] value) { try { return MessageDigest.getInstance("SHA").digest(value); } catch (Exception e) { throw new UnsupportedOperationException(e.toString()); } }
java
private static void writeItems(final Collection<Item> itemCollection, final DataOutput dos, final boolean dotted) throws IOException { int size = itemCollection.size(); Item[] items = itemCollection.toArray(new Item[size]); Arrays.sort(items); for (int i = 0; i < size; i++) {...
java
public VacuumStatus status() throws CommandExecutionException { JSONArray resp = sendToArray("get_status"); JSONObject stat = resp.optJSONObject(0); if (stat == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return new VacuumStatus(stat); ...
java
public TimeZone getTimezone() throws CommandExecutionException { JSONArray resp = sendToArray("get_timezone"); String zone = resp.optString(0, null); if (zone == null ) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return TimeZone.getTimeZone(zone...
java
public boolean setTimezone(TimeZone zone) throws CommandExecutionException { if (zone == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONArray tz = new JSONArray(); tz.put(zone.getID()); return sendOk("set_timezone", tz); }
java
public VacuumConsumableStatus consumableStatus() throws CommandExecutionException { JSONArray resp = sendToArray("get_consumable"); JSONObject stat = resp.optJSONObject(0); if (stat == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return new...
java
public boolean resetConsumable(VacuumConsumableStatus.Names consumable) throws CommandExecutionException { if (consumable == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONArray params = new JSONArray(); params.put(consumable.toString()); ...
java
public int getFanSpeed() throws CommandExecutionException { int resp = sendToArray("get_custom_mode").optInt(0, -1); if ((resp < 0) || (resp > 100)) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); return resp; }
java
public boolean setFanSpeed(int speed) throws CommandExecutionException { if (speed < 0 || speed > 100) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONArray params = new JSONArray(); params.put(speed); return sendOk("set_custom_mode", params);...
java
public VacuumTimer[] getTimers() throws CommandExecutionException { JSONArray tm = sendToArray("get_timer"); if (tm == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); VacuumTimer[] timers = new VacuumTimer[tm.length()]; for (int i = 0; i < tm....
java
public boolean addTimer(VacuumTimer timer) throws CommandExecutionException { if (timer == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONArray tm = timer.construct(); if (tm == null) return false; JSONArray payload = new JSONArray(); ...
java
public boolean setTimerEnabled(VacuumTimer timer) throws CommandExecutionException { if (timer == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONArray payload = new JSONArray(); payload.put(timer.getID()); payload.put(timer.getOnOff());...
java
public boolean removeTimer(VacuumTimer timer) throws CommandExecutionException { if (timer == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONArray payload = new JSONArray(); payload.put(timer.getID()); return sendOk("del_timer", payload...
java
public boolean setDoNotDisturb(VacuumDoNotDisturb dnd) throws CommandExecutionException { if (dnd == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); return sendOk("set_dnd_timer", dnd.construct()); }
java
public boolean goTo(int[] p) throws CommandExecutionException { if (p == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); if (p.length != 2) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONArray payload = ...
java
public VacuumCleanup[] getAllCleanups() throws CommandExecutionException { JSONArray cleanupIDs = getCleaningSummary().optJSONArray(3); if (cleanupIDs == null) return null; VacuumCleanup[] res = new VacuumCleanup[cleanupIDs.length()]; for (int i = 0; i < cleanupIDs.length(); i++){ ...
java
public int getSoundVolume() throws CommandExecutionException { JSONArray res = sendToArray("get_sound_volume"); if (res == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_RESPONSE); int vol = res.optInt(0, -1); if (vol < 0) throw new CommandExecutionExce...
java
public boolean setSoundVolume(int volume) throws CommandExecutionException { if (volume < 0) volume = 0; if (volume > 100) volume = 100; JSONArray payload = new JSONArray(); payload.put(volume); return sendOk("change_sound_volume", payload); }
java
public boolean manualControlMove(float rotationSpeed, float speed, int runDuration) throws CommandExecutionException { if (manualControlSequence < 1) manualControlStart(); JSONObject payload = new JSONObject(); if (rotationSpeed > 180.0f) rotationSpeed = 180.0f; if (rotationSpeed < -180....
java
public VacuumSounpackInstallState installSoundpack(String url, String md5, int soundId) throws CommandExecutionException { if (url == null || md5 == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS); JSONObject install = new JSONObject(); install.put("...
java
public VacuumSounpackInstallState soundpackInstallStatus() throws CommandExecutionException { JSONArray ret = sendToArray("get_sound_progress"); if (ret == null) return null; return new VacuumSounpackInstallState(ret.optJSONObject(0)); }
java
public JSONObject getCarpetModeState() throws CommandExecutionException { JSONArray ret = sendToArray("get_carpet_mode"); if (ret == null) return null; return ret.optJSONObject(0); }
java
public boolean setCarpetMode(boolean enabled, int high, int low, int integral, int stallTime) throws CommandExecutionException { JSONObject payload = new JSONObject(); payload.put("enable", enabled ? 1:0); payload.put("current_high", high); payload.put("current_low", low); payloa...
java
public String getSerialnumber() throws CommandExecutionException { JSONArray ret = sendToArray("get_serial_number"); if (ret == null) return null; return ret.optJSONObject(0).optString("serial_number"); }
java
public int newLocal(final Type type) { Object t; switch (type.getSort()) { case Type.BOOLEAN: case Type.CHAR: case Type.BYTE: case Type.SHORT: case Type.INT: t = Opcodes.INTEGER; break; case Type.FLOAT: t = Opcodes.FLOAT...
java
private List<Fight> getFights(Elements trs, Fighter fighter) throws ArrayIndexOutOfBoundsException { List<Fight> fights = new ArrayList<>(); logger.info("{} TRs to parse through", trs.size()); SherdogBaseObject sFighter = new SherdogBaseObject(); sFighter.setName(fighter.getName()); ...
java
private SherdogBaseObject getOpponent(Element td) { SherdogBaseObject opponent = new SherdogBaseObject(); Element opponentLink = td.select("a").get(0); opponent.setName(opponentLink.html()); opponent.setSherdogUrl(opponentLink.attr("abs:href")); return opponent; }
java
private SherdogBaseObject getEvent(Element td) { Element link = td.select("a").get(0); SherdogBaseObject event = new SherdogBaseObject(); event.setName(link.html().replaceAll("<span itemprop=\"award\">|</span>", "")); event.setSherdogUrl(link.attr("abs:href")); return event; ...
java
private ZonedDateTime getDate(Element td) { //date Element date = td.select("span.sub_line").first(); return ParserUtils.getDateFromStringToZoneId(date.html(), ZONE_ID, DateTimeFormatter.ofPattern("MMM / dd / yyyy", Locale.US)); }
java
private static int parseType(final String signature, int pos, final SignatureVisitor v) { char c; int start, end; boolean visited, inner; String name; switch (c = signature.charAt(pos++)) { case 'Z': case 'C': case 'B': case 'S': ...
java
protected int getSortFieldIndex() { SortParam sp = getSort(); Integer index = fieldNameToIndex.get(sp.getProperty()); if (index == null) { index = 1; } return index; }
java
@Override public Map<BeanId, Bean> getBeanToValidate(Collection<Bean> beans) throws AbortRuntimeException { Map<BeanId, Bean> beansToValidate = new HashMap<>(); for (Bean bean : beans) { Map<BeanId, Bean> predecessors = new HashMap<>(); // beans read from xml storage will onl...
java
protected ApplicationContext getApplicationContext(JobExecutionContext context) throws SchedulerException { final SchedulerContext schedulerContext = context.getScheduler().getContext(); ApplicationContext applicationContext = (ApplicationContext) schedulerContext.get(APPLICATION_CONTEXT_K...
java
private void checkSystemInput() throws IOException { while ( System.in.available() > 0 ) { int input = System.in.read(); if ( input >= 0 ) { char c = (char) input; if ( c == '\n' ) { synch...
java
protected void executePostMethod( HttpInvokerClientConfiguration config, HttpClient httpClient, PostMethod postMethod) throws IOException { httpClient.executeMethod(postMethod); }
java
public static KeyValue getReferenceKeyValue(byte[] rowkey, String propertyName, String schemaName, List<BeanId> refs, UniqueIds uids) { final byte[] pid = uids.getUsid().getId(propertyName); final byte[] sid = uids.getUsid().getId(schemaName); final byte[] qual = new byte[] { sid[0],...
java
public void setReferencesOn(Bean bean) { for (KeyValue ref : references.values()) { final byte[] sidpid = ref.getQualifier(); final byte[] iids = ref.getValue(); final byte[] sid = new byte[] { sidpid[0], sidpid[1] }; final byte[] pid = new byte[] { sidpid[2], sid...
java
public static boolean isReference(KeyValue kv) { if (Bytes.equals(kv.getFamily(), REF_COLUMN_FAMILY)) { return true; } return false; }
java
public static byte[] getIids(final List<String> ids, final UniqueIds uids) { final int size = ids.size(); final byte[] iids = new byte[IID_WIDTH * size]; for (int i = 0; i < size; i++) { final String instanceId = ids.get(i); final byte[] iid = uids.getUiid().getId(instanc...
java
private static byte[] getIids2(final List<BeanId> ids, final UniqueIds uids) { if (ids == null) { return new byte[0]; } final AbstractList<String> list = new AbstractList<String>() { @Override public String get(int index) { return ids.get(inde...
java