id
stringlengths
7
14
text
stringlengths
1
106k
1553760_4
@Override public String generateId(String headingText) { String id = headingText.toLowerCase(Locale.getDefault()); id = id.replaceAll("[^a-z0-9_-]", "-"); //$NON-NLS-1$//$NON-NLS-2$ CharMatcher hyphenMatcher = CharMatcher.is('-'); id = hyphenMatcher.trimFrom(hyphenMatcher.collapseFrom(id, '-')); return id; }
1553760_5
@Override public String generateId(String headingText) { String id = headingText.toLowerCase(Locale.getDefault()); id = id.replaceAll("[^a-z0-9_-]", "-"); //$NON-NLS-1$//$NON-NLS-2$ CharMatcher hyphenMatcher = CharMatcher.is('-'); id = hyphenMatcher.trimFrom(hyphenMatcher.collapseFrom(id, '-')); return id; }
1553760_6
@Override public String generateId(String headingText) { String id = headingText.toLowerCase(Locale.getDefault()); id = id.replaceAll("[^a-z0-9_-]", "-"); //$NON-NLS-1$//$NON-NLS-2$ CharMatcher hyphenMatcher = CharMatcher.is('-'); id = hyphenMatcher.trimFrom(hyphenMatcher.collapseFrom(id, '-')); return id; }
1553760_7
@Override public String generateId(String headingText) { String id = headingText.toLowerCase(Locale.getDefault()); id = id.replaceAll("[^a-z0-9_-]", "-"); //$NON-NLS-1$//$NON-NLS-2$ CharMatcher hyphenMatcher = CharMatcher.is('-'); id = hyphenMatcher.trimFrom(hyphenMatcher.collapseFrom(id, '-')); return id; }
1553760_8
@Override public boolean canStart(String line, int lineOffset) { blockLineCount = 0; if (lineOffset == 0) { matcher = startPattern.matcher(line); return matcher.matches(); } else { matcher = null; return false; } }
1553760_9
public void setPreprocessFootnotes(boolean preprocessFootnotes) { this.preprocessFootnotes = preprocessFootnotes; }
1554165_0
public HashMap<Enum, String> getDb() { return db; }
1554165_1
public HashMap<String, Enum> getVal() { return val; }
1554165_2
public synchronized Object getData(int requestTypeId, Object requestData) { Object returnData = null; switch (requestTypeId) { case RequestTypeId.FIND_PERSON_MPI: case RequestTypeId.FIND_PERSON_LPI: Mediator.getLogger(Mpi.class.getName()).log(Level.FINE, "FindPerson"); returnData = personList.find((PersonRequest) requestData); break; case RequestTypeId.CREATE_PERSON_MPI: case RequestTypeId.CREATE_PERSON_LPI: Mediator.getLogger(Mpi.class.getName()).log(Level.FINE, "CreatePerson"); returnData = personList.create((PersonRequest) requestData); break; case RequestTypeId.MODIFY_PERSON_MPI: case RequestTypeId.MODIFY_PERSON_LPI: Mediator.getLogger(Mpi.class.getName()).log(Level.FINE, "ModifyPerson"); returnData = personList.modify((PersonRequest) requestData); break; default: Logger.getLogger(Mpi.class.getName()).log(Level.SEVERE, "getData() called with unepxected requestTypeId {0}", requestTypeId); break; } return returnData; }
1555964_8
public boolean isBitSet(int bit) { long bitMask = Long.rotateLeft(1, bit); long result = this.bitMaskValue & bitMask; if (result != 0) { return true; } return false; }
1555964_9
public boolean isBitSet(int bit) { long bitMask = Long.rotateLeft(1, bit); long result = this.bitMaskValue & bitMask; if (result != 0) { return true; } return false; }
1557148_0
public static boolean isEmpty(final String text) { return text == null || text.length() == 0; }
1557148_1
public static void close(InputStream is) { if (is != null) { try { is.close(); } catch (Exception e2) { } } }
1557148_2
public static void close(InputStream is) { if (is != null) { try { is.close(); } catch (Exception e2) { } } }
1557148_3
public static Integer getYear(Calendar calendar) { Integer year = calendar.get(Calendar.YEAR); return year; }
1557148_4
public static Integer getYear(Calendar calendar) { Integer year = calendar.get(Calendar.YEAR); return year; }
1557148_5
public static Integer getYear(Calendar calendar) { Integer year = calendar.get(Calendar.YEAR); return year; }
1557148_6
public static Integer getYear(Calendar calendar) { Integer year = calendar.get(Calendar.YEAR); return year; }
1557148_7
public static Integer getYear(Calendar calendar) { Integer year = calendar.get(Calendar.YEAR); return year; }
1557148_8
public static Integer getMonth(Calendar calendar) { Integer month = calendar.get(Calendar.MONTH) + 1; return month; }
1557148_9
public static Integer getMonth(Calendar calendar) { Integer month = calendar.get(Calendar.MONTH) + 1; return month; }
1558503_0
public static Date create(int year, int month, int date) { Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(year, month - 1, date); return cal.getTime(); }
1558503_1
public static Date create(int year, int month, int date) { Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(year, month - 1, date); return cal.getTime(); }
1558503_2
@Override public int columns() { return props.length; }
1558503_3
@Override public int rows() { return pojoList.size(); }
1558503_4
@Override public Object get(int row, int column) { Object pojo = pojoList.get(row); beanWrapper.setWrappedInstance(pojo); TypeDescriptor fieldDesc = beanWrapper .getPropertyTypeDescriptor(props[column]); TypeDescriptor strDesc = TypeDescriptor.valueOf(String.class); Object value = beanWrapper.getPropertyValue(props[column]); if (canConvert(value, fieldDesc, strDesc)) { return this.conversionService.convert(value, fieldDesc, strDesc); } else { return value; } }
1558503_5
@Override public void set(int row, int column, Object value) { Object pojo = pojoList.get(row); beanWrapper.setWrappedInstance(pojo); TypeDescriptor fieldDesc = beanWrapper .getPropertyTypeDescriptor(props[column]); TypeDescriptor strDesc = TypeDescriptor.valueOf(String.class); if (canConvert(value, fieldDesc, strDesc)) { beanWrapper.setPropertyValue(props[column], conversionService.convert(value, strDesc, fieldDesc)); } else { beanWrapper.setPropertyValue(props[column], value); } }
1558503_6
@Override public Object[][] toArray2D() { Object[][] result = new Object[rows()][columns()]; for (int row = 0; row < rows(); row++) { for (int column = 0; column < columns(); column++) { result[row][column] = get(row, column); } } return result; }
1575956_0
String name() { return spec.name(); }
1575956_1
String name() { return spec.name(); }
1575956_2
String name() { return spec.name(); }
1575956_3
String name() { return spec.name(); }
1575956_4
@Override public StatsLogger getStatsLogger(String scope) { return this.cachingStatsProvider.getStatsLogger(scope); }
1575956_5
@Override public void start(Configuration conf) { boolean httpEnabled = conf.getBoolean(PROMETHEUS_STATS_HTTP_ENABLE, DEFAULT_PROMETHEUS_STATS_HTTP_ENABLE); boolean bkHttpServerEnabled = conf.getBoolean("httpServerEnabled", false); // only start its own http server when prometheus http is enabled and bk http server is not enabled. if (httpEnabled && !bkHttpServerEnabled) { int httpPort = conf.getInt(PROMETHEUS_STATS_HTTP_PORT, DEFAULT_PROMETHEUS_STATS_HTTP_PORT); InetSocketAddress httpEndpoint = InetSocketAddress.createUnresolved("0.0.0.0", httpPort); this.server = new Server(httpEndpoint); ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); server.setHandler(context); context.addServlet(new ServletHolder(new PrometheusServlet(this)), "/metrics"); try { server.start(); log.info("Started Prometheus stats endpoint at {}", httpEndpoint); } catch (Exception e) { throw new RuntimeException(e); } } // Include standard JVM stats registerMetrics(new StandardExports()); registerMetrics(new MemoryPoolsExports()); registerMetrics(new GarbageCollectorExports()); registerMetrics(new ThreadExports()); // Add direct memory allocated through unsafe registerMetrics(Gauge.build("jvm_memory_direct_bytes_used", "-").create().setChild(new Child() { @Override public double get() { return directMemoryUsage != null ? directMemoryUsage.longValue() : Double.NaN; } })); registerMetrics(Gauge.build("jvm_memory_direct_bytes_max", "-").create().setChild(new Child() { @Override public double get() { return PlatformDependent.maxDirectMemory(); } })); executor = Executors.newSingleThreadScheduledExecutor(new DefaultThreadFactory("metrics")); int latencyRolloverSeconds = conf.getInt(PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS, DEFAULT_PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS); executor.scheduleAtFixedRate(() -> { rotateLatencyCollection(); }, 1, latencyRolloverSeconds, TimeUnit.SECONDS); }
1575956_6
@Override public StatsLogger getStatsLogger(String scope) { return this.cachingStatsProvider.getStatsLogger(scope); }
1575956_7
public synchronized void run() throws Exception { long start = System.currentTimeMillis(); long testEnd = start + (duration * 1000); long testDrainEnd = testEnd + (drainTimeout * 1000); /* Keep IO running until testEnd */ while (System.currentTimeMillis() < testEnd) { /* see startRead and startWrite, they return false once no more IO can be started */ while (startRead() || startWrite()) {} long toWait = testEnd - System.currentTimeMillis(); /* atomically wait for either IO to complete or the test to end */ this.wait(toWait < 0 ? 0 : toWait); printThrowExceptions(); } /* Wait for all in progress ops to complete, outstanding*Count is updated under the lock */ while ((System.currentTimeMillis() < testDrainEnd) && (outstandingReadCount > 0 || outstandingWriteCount > 0)) { System.out.format("reads: %d, writes: %d%n", outstandingReadCount, outstandingWriteCount); System.out.format("openingLedgers:%n"); for (LedgerInfo li: openingLedgers) { System.out.format( "Ledger %d has reads: %d, writes: %d%n", li.ledgerID, li.readsInProgress, li.writesInProgress.size()); } System.out.format("openLedgers:%n"); for (LedgerInfo li: openLedgers) { System.out.format( "Ledger %d has reads: %d, writes: %d%n", li.ledgerID, li.readsInProgress, li.writesInProgress.size()); } System.out.format("liveLedgers:%n"); for (LedgerInfo li: liveLedgers) { System.out.format( "Ledger %d has reads: %d, writes: %d%n", li.ledgerID, li.readsInProgress, li.writesInProgress.size()); } long toWait = testDrainEnd - System.currentTimeMillis(); this.wait(toWait < 0 ? 0 : toWait); printThrowExceptions(); } if (outstandingReadCount > 0 || outstandingWriteCount > 0) { throw new Exception("Failed to drain ops before timeout%n"); } }
1575956_8
@SuppressWarnings("deprecation") @SneakyThrows(InterruptedException.class) protected void initialize(AbstractConfiguration<?> conf, StatsLogger statsLogger, RetryPolicy zkRetryPolicy, Optional<Object> optionalCtx) throws MetadataException { this.conf = conf; this.acls = ZkUtils.getACLs(conf); if (optionalCtx.isPresent() && optionalCtx.get() instanceof ZooKeeper) { this.ledgersRootPath = conf.getZkLedgersRootPath(); log.info("Initialize zookeeper metadata driver with external zookeeper client : ledgersRootPath = {}.", ledgersRootPath); // if an external zookeeper is added, use the zookeeper instance this.zk = (ZooKeeper) (optionalCtx.get()); this.ownZKHandle = false; } else { final String metadataServiceUriStr; try { metadataServiceUriStr = conf.getMetadataServiceUri(); } catch (ConfigurationException e) { log.error("Failed to retrieve metadata service uri from configuration", e); throw new MetadataException( Code.INVALID_METADATA_SERVICE_URI, e); } URI metadataServiceUri = URI.create(metadataServiceUriStr); // get the initialize root path this.ledgersRootPath = metadataServiceUri.getPath(); final String bookieRegistrationPath = ledgersRootPath + "/" + AVAILABLE_NODE; final String bookieReadonlyRegistrationPath = bookieRegistrationPath + "/" + READONLY; // construct the zookeeper final String zkServers = getZKServersFromServiceUri(metadataServiceUri); log.info("Initialize zookeeper metadata driver at metadata service uri {} :" + " zkServers = {}, ledgersRootPath = {}.", metadataServiceUriStr, zkServers, ledgersRootPath); try { this.zk = ZooKeeperClient.newBuilder() .connectString(zkServers) .sessionTimeoutMs(conf.getZkTimeout()) .operationRetryPolicy(zkRetryPolicy) .requestRateLimit(conf.getZkRequestRateLimit()) .statsLogger(statsLogger) .build(); if (null == zk.exists(bookieReadonlyRegistrationPath, false)) { try { zk.create(bookieReadonlyRegistrationPath, EMPTY_BYTE_ARRAY, acls, CreateMode.PERSISTENT); } catch (KeeperException.NodeExistsException e) { // this node is just now created by someone. } catch (KeeperException.NoNodeException e) { // the cluster hasn't been initialized } } } catch (IOException | KeeperException e) { log.error("Failed to create zookeeper client to {}", zkServers, e); MetadataException me = new MetadataException( Code.METADATA_SERVICE_ERROR, "Failed to create zookeeper client to " + zkServers, e); me.fillInStackTrace(); throw me; } this.ownZKHandle = true; } // once created the zookeeper client, create the layout manager and registration client this.layoutManager = new ZkLayoutManager( zk, ledgersRootPath, acls); }
1575956_9
@SneakyThrows public synchronized LedgerManagerFactory getLedgerManagerFactory() throws MetadataException { if (null == lmFactory) { try { lmFactory = AbstractZkLedgerManagerFactory.newLedgerManagerFactory( conf, layoutManager); } catch (IOException e) { throw new MetadataException( Code.METADATA_SERVICE_ERROR, "Failed to initialized ledger manager factory", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw e; } } return lmFactory; }
1577630_0
public void print(final Value v) throws RippleException { if (null == v) { throw new NullPointerException(); } if (v instanceof IRI) { printURI((IRI) v); } else if (v instanceof Literal) { printLiteral((Literal) v); } else if (v instanceof BNode) { print("_:"); print(((BNode) v).getID()); } else { print(v.toString()); } }
1577630_1
@Override public int arity() { return 2; }
1577630_2
public Object eval(final String script, final ScriptContext context) throws ScriptException { // TODO: use context return eval(script); }
1577630_3
public Object eval(final String script, final ScriptContext context) throws ScriptException { // TODO: use context return eval(script); }
1577630_4
public Object eval(final String script, final ScriptContext context) throws ScriptException { // TODO: use context return eval(script); }
1577630_5
public Object eval(final String script, final ScriptContext context) throws ScriptException { // TODO: use context return eval(script); }
1577630_6
public String getMethodCallSyntax(final String obj, final String m, final String... args) { StringBuilder sb = new StringBuilder(obj); for (String arg : args) { sb.append(" "); sb.append(arg); } sb.append(" "); sb.append(m); sb.append(" >> ."); return sb.toString(); }
1577630_7
public String getProgram(final String... statements) { StringBuilder sb = new StringBuilder(); boolean first = true; for (String st : statements) { if (first) { first = false; } else { sb.append("\n"); } sb.append(st); // It doesn't hurt to add an end-statement token (unless the last // statement ended with continue-statement token...) sb.append("."); } return sb.toString(); }
1577630_8
public Object getParameter(final String key) { return null; //To change body of implemented methods use File | Settings | File Templates. }
1577630_9
public String getOutputStatement(final String toDisplay) { return null; //To change body of implemented methods use File | Settings | File Templates. }
1579900_0
public int getPercentile (float value) { if (value < _min) { return 0; } else if (value > _max) { return 100; } else { return _percentile[toBucketIndex(value)]; } }
1579936_0
public String merge (String newlyGenerated, String previouslyGenerated) throws Exception { // Extract the generated section names from the output and make sure they're all matched Map<String, Section> sections = Maps.newLinkedHashMap(); Matcher m = _sectionDelimiter.matcher(newlyGenerated); while (m.find()) { Section section = extractGeneratedSection(m, newlyGenerated); Preconditions.checkArgument(!sections.containsKey(section.name), "Section '%s' used more than once", section.name); sections.put(section.name, section); } // Merge with the previously generated source StringBuilder merged = new StringBuilder(); m = _sectionDelimiter.matcher(previouslyGenerated); int currentStart = 0; while (m.find()) { merged.append(previouslyGenerated.substring(currentStart, m.start())); Section existingSection = extractGeneratedSection(m, previouslyGenerated); Section newSection = sections.remove(existingSection.name); if (newSection == null) { // Allow generated sections to be dropped in the template, but warn in case // something odd's happening System.err.println("Dropping previously generated section '" + m.group(1) + "' that's no longer generated by the template"); } else if (existingSection.disabled) { // If the existing code disables this generation, add that disabled comment merged.append(existingSection.contents); } else { // Otherwise pop in the newly generated code in the place of what was there before merged.append(newSection.contents); } currentStart = m.end(); } // Add generated sections that weren't present in the old output before the last // non-generated code. It's a 50-50 shot, so warn when this happens for (Section newSection : sections.values()) { System.err.println("Adding previously missing generated section '" + newSection.name + "' before the last non-generated text"); merged.append(newSection.contents); } // Add any text past the last previously generated section merged.append(previouslyGenerated.substring(currentStart)); return merged.toString(); }
1579936_1
public String merge (String newlyGenerated, String previouslyGenerated) throws Exception { // Extract the generated section names from the output and make sure they're all matched Map<String, Section> sections = Maps.newLinkedHashMap(); Matcher m = _sectionDelimiter.matcher(newlyGenerated); while (m.find()) { Section section = extractGeneratedSection(m, newlyGenerated); Preconditions.checkArgument(!sections.containsKey(section.name), "Section '%s' used more than once", section.name); sections.put(section.name, section); } // Merge with the previously generated source StringBuilder merged = new StringBuilder(); m = _sectionDelimiter.matcher(previouslyGenerated); int currentStart = 0; while (m.find()) { merged.append(previouslyGenerated.substring(currentStart, m.start())); Section existingSection = extractGeneratedSection(m, previouslyGenerated); Section newSection = sections.remove(existingSection.name); if (newSection == null) { // Allow generated sections to be dropped in the template, but warn in case // something odd's happening System.err.println("Dropping previously generated section '" + m.group(1) + "' that's no longer generated by the template"); } else if (existingSection.disabled) { // If the existing code disables this generation, add that disabled comment merged.append(existingSection.contents); } else { // Otherwise pop in the newly generated code in the place of what was there before merged.append(newSection.contents); } currentStart = m.end(); } // Add generated sections that weren't present in the old output before the last // non-generated code. It's a 50-50 shot, so warn when this happens for (Section newSection : sections.values()) { System.err.println("Adding previously missing generated section '" + newSection.name + "' before the last non-generated text"); merged.append(newSection.contents); } // Add any text past the last previously generated section merged.append(previouslyGenerated.substring(currentStart)); return merged.toString(); }
1579936_2
public String merge (String newlyGenerated, String previouslyGenerated) throws Exception { // Extract the generated section names from the output and make sure they're all matched Map<String, Section> sections = Maps.newLinkedHashMap(); Matcher m = _sectionDelimiter.matcher(newlyGenerated); while (m.find()) { Section section = extractGeneratedSection(m, newlyGenerated); Preconditions.checkArgument(!sections.containsKey(section.name), "Section '%s' used more than once", section.name); sections.put(section.name, section); } // Merge with the previously generated source StringBuilder merged = new StringBuilder(); m = _sectionDelimiter.matcher(previouslyGenerated); int currentStart = 0; while (m.find()) { merged.append(previouslyGenerated.substring(currentStart, m.start())); Section existingSection = extractGeneratedSection(m, previouslyGenerated); Section newSection = sections.remove(existingSection.name); if (newSection == null) { // Allow generated sections to be dropped in the template, but warn in case // something odd's happening System.err.println("Dropping previously generated section '" + m.group(1) + "' that's no longer generated by the template"); } else if (existingSection.disabled) { // If the existing code disables this generation, add that disabled comment merged.append(existingSection.contents); } else { // Otherwise pop in the newly generated code in the place of what was there before merged.append(newSection.contents); } currentStart = m.end(); } // Add generated sections that weren't present in the old output before the last // non-generated code. It's a 50-50 shot, so warn when this happens for (Section newSection : sections.values()) { System.err.println("Adding previously missing generated section '" + newSection.name + "' before the last non-generated text"); merged.append(newSection.contents); } // Add any text past the last previously generated section merged.append(previouslyGenerated.substring(currentStart)); return merged.toString(); }
1579936_3
public String merge (String newlyGenerated, String previouslyGenerated) throws Exception { // Extract the generated section names from the output and make sure they're all matched Map<String, Section> sections = Maps.newLinkedHashMap(); Matcher m = _sectionDelimiter.matcher(newlyGenerated); while (m.find()) { Section section = extractGeneratedSection(m, newlyGenerated); Preconditions.checkArgument(!sections.containsKey(section.name), "Section '%s' used more than once", section.name); sections.put(section.name, section); } // Merge with the previously generated source StringBuilder merged = new StringBuilder(); m = _sectionDelimiter.matcher(previouslyGenerated); int currentStart = 0; while (m.find()) { merged.append(previouslyGenerated.substring(currentStart, m.start())); Section existingSection = extractGeneratedSection(m, previouslyGenerated); Section newSection = sections.remove(existingSection.name); if (newSection == null) { // Allow generated sections to be dropped in the template, but warn in case // something odd's happening System.err.println("Dropping previously generated section '" + m.group(1) + "' that's no longer generated by the template"); } else if (existingSection.disabled) { // If the existing code disables this generation, add that disabled comment merged.append(existingSection.contents); } else { // Otherwise pop in the newly generated code in the place of what was there before merged.append(newSection.contents); } currentStart = m.end(); } // Add generated sections that weren't present in the old output before the last // non-generated code. It's a 50-50 shot, so warn when this happens for (Section newSection : sections.values()) { System.err.println("Adding previously missing generated section '" + newSection.name + "' before the last non-generated text"); merged.append(newSection.contents); } // Add any text past the last previously generated section merged.append(previouslyGenerated.substring(currentStart)); return merged.toString(); }
1579936_4
public String merge (String newlyGenerated, String previouslyGenerated) throws Exception { // Extract the generated section names from the output and make sure they're all matched Map<String, Section> sections = Maps.newLinkedHashMap(); Matcher m = _sectionDelimiter.matcher(newlyGenerated); while (m.find()) { Section section = extractGeneratedSection(m, newlyGenerated); Preconditions.checkArgument(!sections.containsKey(section.name), "Section '%s' used more than once", section.name); sections.put(section.name, section); } // Merge with the previously generated source StringBuilder merged = new StringBuilder(); m = _sectionDelimiter.matcher(previouslyGenerated); int currentStart = 0; while (m.find()) { merged.append(previouslyGenerated.substring(currentStart, m.start())); Section existingSection = extractGeneratedSection(m, previouslyGenerated); Section newSection = sections.remove(existingSection.name); if (newSection == null) { // Allow generated sections to be dropped in the template, but warn in case // something odd's happening System.err.println("Dropping previously generated section '" + m.group(1) + "' that's no longer generated by the template"); } else if (existingSection.disabled) { // If the existing code disables this generation, add that disabled comment merged.append(existingSection.contents); } else { // Otherwise pop in the newly generated code in the place of what was there before merged.append(newSection.contents); } currentStart = m.end(); } // Add generated sections that weren't present in the old output before the last // non-generated code. It's a 50-50 shot, so warn when this happens for (Section newSection : sections.values()) { System.err.println("Adding previously missing generated section '" + newSection.name + "' before the last non-generated text"); merged.append(newSection.contents); } // Add any text past the last previously generated section merged.append(previouslyGenerated.substring(currentStart)); return merged.toString(); }
1581151_0
public long toLong() { long result = 0L; for (int i = 0; i < array.length; ++i) { result = (result << FULL_BYTE_SHIFT) + (array[i] & FULL_BYTE_MASK); } return result; }
1581151_1
public byte[] toByteArray() { final byte[] tmp = new byte[LENGTH]; System.arraycopy(array, 0, tmp, 0, LENGTH); return tmp; }
1581151_2
public long toLong() { long result = 0L; for (int i = 0; i < array.length; ++i) { result = (result << FULL_BYTE_SHIFT) + (array[i] & FULL_BYTE_MASK); } return result; }
1581151_3
public byte[] toByteArray() { final byte[] tmp = new byte[LENGTH]; System.arraycopy(array, 0, tmp, 0, LENGTH); return tmp; }
1581151_4
public byte[] toByteArray() { final byte[] tmp = new byte[LENGTH]; System.arraycopy(array, 0, tmp, 0, LENGTH); return tmp; }
1581151_5
public long toLong() { long result = 0L; for (int i = 0; i < array.length; ++i) { result = (result << FULL_BYTE_SHIFT) + (array[i] & FULL_BYTE_MASK); } return result; }
1581151_6
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final MacAddress that = (MacAddress) o; return Arrays.equals(array, that.array); }
1581151_7
@Override public int hashCode() { return Arrays.hashCode(array); }
1581151_8
public MacAddress to16BitMacAddress() { byte[] result = new byte[LENGTH]; int offset = LENGTH - 2; System.arraycopy(array, offset, result, offset, 2); return new MacAddress(result); }
1583138_0
@Override public boolean isRunning() { return !fired; }
1583138_1
@Override public boolean isRunning() { return !fired; }
1583138_2
public int getTotalPages() { return totalPages; }
1583138_3
public static double minimumDifference(double a, double b) { double diffAngle = b - a; if (diffAngle > 180) diffAngle -= 360; else if (diffAngle < -180) diffAngle += 360; return diffAngle; }
1583138_4
@Override public boolean isEmpty() { return items.isEmpty(); }
1583138_5
@Override public boolean isEmpty() { return items.isEmpty(); }
1583138_6
public void update() { boolean down = isDown(); pressed = !wasDown && down; released = wasDown && !down; holded = down && !pressed; wasDown = down; }
1583138_7
public void update() { boolean down = isDown(); pressed = !wasDown && down; released = wasDown && !down; holded = down && !pressed; wasDown = down; }
1583138_8
public void update() { boolean down = isDown(); pressed = !wasDown && down; released = wasDown && !down; holded = down && !pressed; wasDown = down; }
1583138_9
public void update() { boolean down = isDown(); pressed = !wasDown && down; released = wasDown && !down; holded = down && !pressed; wasDown = down; }
1584558_0
public static boolean isHiddenSingle(SDKSquare s, SDKBoard board) { LinkedList<SDKSquare> zsqrs = board.getSquaresInZone(s); zsqrs.remove(s); LinkedList<SDKSquare> csqrs = board.getSquaresInCol(s.col); csqrs.remove(s); LinkedList<SDKSquare> rsqrs = board.getSquaresInRow(s.row); rsqrs.remove(s); HashSet<Integer> zonePossibles = s.getPossible(); HashSet<Integer> rowPossibles = s.getPossible(); HashSet<Integer> colPossibles = s.getPossible(); for(SDKSquare s2 : rsqrs) rowPossibles.removeAll(s2.getPossible()); for(SDKSquare s2 : csqrs) colPossibles.removeAll(s2.getPossible()); for(SDKSquare s2 : zsqrs) zonePossibles.removeAll(s2.getPossible()); return rowPossibles.size() == 1 || colPossibles.size() == 1 || zonePossibles.size() == 1; }
1589946_0
public static List<Category> fromCatalogAPI(TaxonomyResponse response) { if (response == null || response.getTaxonomy() == null) { return null; } return convertChildren(response.getTaxonomy().getCategories()); }
1589946_1
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof Rating)) { return false; } Rating rhs = (Rating) o; return new EqualsBuilder() .append(dimension, rhs.dimension) .append(value, rhs.value) .append(max, rhs.max) .append(min, rhs.min) .isEquals(); }
1589946_2
public static MerchantResponse fromCatalogAPI(MerchantsResponse response) { final MerchantResponse output = new MerchantResponse(); output.setMerchants(convertMerchants(response)); return output; }
1589946_3
public static MerchantResponse fromCatalogAPI(MerchantsResponse response) { final MerchantResponse output = new MerchantResponse(); output.setMerchants(convertMerchants(response)); return output; }
1589946_4
public static CatalogResponse fromCatalogAPI(ProductResponse result) { if (result == null) { return null; } CatalogResponse toReturn = new CatalogResponse(); Classification classification = result.getClassification(); if (classification != null) { toReturn.setRelevancyScore(classification.getRelevancyScore()); } /* * attributes */ RelatedAttributes catalogAttributes = result.getRelatedAttributes(); if (catalogAttributes != null && CollectionUtils.isNotEmpty(catalogAttributes.getAttribute())) { ArrayList<Attribute> attributes = new ArrayList<Attribute>(catalogAttributes.getAttribute() .size()); for (AttributeType a : catalogAttributes.getAttribute()) { Attribute attr = new Attribute(); attr.setId(a.getId()); attr.setLabel(a.getName()); AttributeValues catalogValues = a.getAttributeValues(); if (catalogValues != null && CollectionUtils.isNotEmpty(catalogValues.getAttributeValue())) { ArrayList<AttributeValue> values = new ArrayList<AttributeValue>(catalogValues.getAttributeValue() .size()); for (AttributeValueType t : catalogValues.getAttributeValue()) { AttributeValue v = new AttributeValue(); v.setLabel(t.getId()); v.setValue(t.getName()); values.add(v); } attr.setValues(values); } attributes.add(attr); } toReturn.setRelatedAttributes(attributes); } /* * offers */ final ArrayList<Offer> offers = new ArrayList<Offer>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getProducts().getProductOrOffer())); } if (result.getOffers() != null && CollectionUtils.isNotEmpty(result.getOffers().getOffer())) { toReturn.setTotalResults(result.getOffers().getTotalResults()); toReturn.setIncludedResults(result.getOffers().getIncludedResults()); final PriceSetType priceSet = result.getOffers().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getOffers().getOffer())); } toReturn.setOffers(offers); final ArrayList<Product> products = new ArrayList<Product>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } products.addAll(convertProducts(result.getProducts().getProductOrOffer())); } toReturn.setProducts(products); return toReturn; }
1589946_5
public static CatalogResponse fromCatalogAPI(ProductResponse result) { if (result == null) { return null; } CatalogResponse toReturn = new CatalogResponse(); Classification classification = result.getClassification(); if (classification != null) { toReturn.setRelevancyScore(classification.getRelevancyScore()); } /* * attributes */ RelatedAttributes catalogAttributes = result.getRelatedAttributes(); if (catalogAttributes != null && CollectionUtils.isNotEmpty(catalogAttributes.getAttribute())) { ArrayList<Attribute> attributes = new ArrayList<Attribute>(catalogAttributes.getAttribute() .size()); for (AttributeType a : catalogAttributes.getAttribute()) { Attribute attr = new Attribute(); attr.setId(a.getId()); attr.setLabel(a.getName()); AttributeValues catalogValues = a.getAttributeValues(); if (catalogValues != null && CollectionUtils.isNotEmpty(catalogValues.getAttributeValue())) { ArrayList<AttributeValue> values = new ArrayList<AttributeValue>(catalogValues.getAttributeValue() .size()); for (AttributeValueType t : catalogValues.getAttributeValue()) { AttributeValue v = new AttributeValue(); v.setLabel(t.getId()); v.setValue(t.getName()); values.add(v); } attr.setValues(values); } attributes.add(attr); } toReturn.setRelatedAttributes(attributes); } /* * offers */ final ArrayList<Offer> offers = new ArrayList<Offer>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getProducts().getProductOrOffer())); } if (result.getOffers() != null && CollectionUtils.isNotEmpty(result.getOffers().getOffer())) { toReturn.setTotalResults(result.getOffers().getTotalResults()); toReturn.setIncludedResults(result.getOffers().getIncludedResults()); final PriceSetType priceSet = result.getOffers().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getOffers().getOffer())); } toReturn.setOffers(offers); final ArrayList<Product> products = new ArrayList<Product>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } products.addAll(convertProducts(result.getProducts().getProductOrOffer())); } toReturn.setProducts(products); return toReturn; }
1589946_6
public static CatalogResponse fromCatalogAPI(ProductResponse result) { if (result == null) { return null; } CatalogResponse toReturn = new CatalogResponse(); Classification classification = result.getClassification(); if (classification != null) { toReturn.setRelevancyScore(classification.getRelevancyScore()); } /* * attributes */ RelatedAttributes catalogAttributes = result.getRelatedAttributes(); if (catalogAttributes != null && CollectionUtils.isNotEmpty(catalogAttributes.getAttribute())) { ArrayList<Attribute> attributes = new ArrayList<Attribute>(catalogAttributes.getAttribute() .size()); for (AttributeType a : catalogAttributes.getAttribute()) { Attribute attr = new Attribute(); attr.setId(a.getId()); attr.setLabel(a.getName()); AttributeValues catalogValues = a.getAttributeValues(); if (catalogValues != null && CollectionUtils.isNotEmpty(catalogValues.getAttributeValue())) { ArrayList<AttributeValue> values = new ArrayList<AttributeValue>(catalogValues.getAttributeValue() .size()); for (AttributeValueType t : catalogValues.getAttributeValue()) { AttributeValue v = new AttributeValue(); v.setLabel(t.getId()); v.setValue(t.getName()); values.add(v); } attr.setValues(values); } attributes.add(attr); } toReturn.setRelatedAttributes(attributes); } /* * offers */ final ArrayList<Offer> offers = new ArrayList<Offer>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getProducts().getProductOrOffer())); } if (result.getOffers() != null && CollectionUtils.isNotEmpty(result.getOffers().getOffer())) { toReturn.setTotalResults(result.getOffers().getTotalResults()); toReturn.setIncludedResults(result.getOffers().getIncludedResults()); final PriceSetType priceSet = result.getOffers().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getOffers().getOffer())); } toReturn.setOffers(offers); final ArrayList<Product> products = new ArrayList<Product>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } products.addAll(convertProducts(result.getProducts().getProductOrOffer())); } toReturn.setProducts(products); return toReturn; }
1589946_7
public static CatalogResponse fromCatalogAPI(ProductResponse result) { if (result == null) { return null; } CatalogResponse toReturn = new CatalogResponse(); Classification classification = result.getClassification(); if (classification != null) { toReturn.setRelevancyScore(classification.getRelevancyScore()); } /* * attributes */ RelatedAttributes catalogAttributes = result.getRelatedAttributes(); if (catalogAttributes != null && CollectionUtils.isNotEmpty(catalogAttributes.getAttribute())) { ArrayList<Attribute> attributes = new ArrayList<Attribute>(catalogAttributes.getAttribute() .size()); for (AttributeType a : catalogAttributes.getAttribute()) { Attribute attr = new Attribute(); attr.setId(a.getId()); attr.setLabel(a.getName()); AttributeValues catalogValues = a.getAttributeValues(); if (catalogValues != null && CollectionUtils.isNotEmpty(catalogValues.getAttributeValue())) { ArrayList<AttributeValue> values = new ArrayList<AttributeValue>(catalogValues.getAttributeValue() .size()); for (AttributeValueType t : catalogValues.getAttributeValue()) { AttributeValue v = new AttributeValue(); v.setLabel(t.getId()); v.setValue(t.getName()); values.add(v); } attr.setValues(values); } attributes.add(attr); } toReturn.setRelatedAttributes(attributes); } /* * offers */ final ArrayList<Offer> offers = new ArrayList<Offer>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getProducts().getProductOrOffer())); } if (result.getOffers() != null && CollectionUtils.isNotEmpty(result.getOffers().getOffer())) { toReturn.setTotalResults(result.getOffers().getTotalResults()); toReturn.setIncludedResults(result.getOffers().getIncludedResults()); final PriceSetType priceSet = result.getOffers().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getOffers().getOffer())); } toReturn.setOffers(offers); final ArrayList<Product> products = new ArrayList<Product>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } products.addAll(convertProducts(result.getProducts().getProductOrOffer())); } toReturn.setProducts(products); return toReturn; }
1589946_8
public static CatalogResponse fromCatalogAPI(ProductResponse result) { if (result == null) { return null; } CatalogResponse toReturn = new CatalogResponse(); Classification classification = result.getClassification(); if (classification != null) { toReturn.setRelevancyScore(classification.getRelevancyScore()); } /* * attributes */ RelatedAttributes catalogAttributes = result.getRelatedAttributes(); if (catalogAttributes != null && CollectionUtils.isNotEmpty(catalogAttributes.getAttribute())) { ArrayList<Attribute> attributes = new ArrayList<Attribute>(catalogAttributes.getAttribute() .size()); for (AttributeType a : catalogAttributes.getAttribute()) { Attribute attr = new Attribute(); attr.setId(a.getId()); attr.setLabel(a.getName()); AttributeValues catalogValues = a.getAttributeValues(); if (catalogValues != null && CollectionUtils.isNotEmpty(catalogValues.getAttributeValue())) { ArrayList<AttributeValue> values = new ArrayList<AttributeValue>(catalogValues.getAttributeValue() .size()); for (AttributeValueType t : catalogValues.getAttributeValue()) { AttributeValue v = new AttributeValue(); v.setLabel(t.getId()); v.setValue(t.getName()); values.add(v); } attr.setValues(values); } attributes.add(attr); } toReturn.setRelatedAttributes(attributes); } /* * offers */ final ArrayList<Offer> offers = new ArrayList<Offer>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getProducts().getProductOrOffer())); } if (result.getOffers() != null && CollectionUtils.isNotEmpty(result.getOffers().getOffer())) { toReturn.setTotalResults(result.getOffers().getTotalResults()); toReturn.setIncludedResults(result.getOffers().getIncludedResults()); final PriceSetType priceSet = result.getOffers().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } offers.addAll(convertOffers(result.getOffers().getOffer())); } toReturn.setOffers(offers); final ArrayList<Product> products = new ArrayList<Product>(); if (result.getProducts() != null && CollectionUtils.isNotEmpty(result.getProducts().getProductOrOffer())) { toReturn.setTotalResults(result.getProducts().getTotalResults()); toReturn.setIncludedResults(result.getProducts().getIncludedResults()); final PriceSetType priceSet = result.getProducts().getPriceSet(); if (priceSet != null) { toReturn.setMaxPrice(convertPrice(priceSet.getMaxPrice())); toReturn.setMinPrice(convertPrice(priceSet.getMinPrice())); } products.addAll(convertProducts(result.getProducts().getProductOrOffer())); } toReturn.setProducts(products); return toReturn; }
1589946_9
public static AttributeSearchResponse fromCatalogAPI(AttributeResponse result) { AttributeSearchResponse attributeSearchResponse = new AttributeSearchResponse(); if (inputIsValid(result)) { return attributeSearchResponse; } AttributeResponse.Attributes resultAttributes = result.getAttributes(); attributeSearchResponse.setIncludedResults(result.getIncludedResults().intValue()); AttributeSearchResponse.Attributes attributes = new AttributeSearchResponse.Attributes(); attributeSearchResponse.setAttributes(attributes); for (AttributeType attributeType : resultAttributes.getAttribute()) { attributes.getAttribute().add(attributeType); } return attributeSearchResponse; }
1592475_0
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_1
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_2
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_3
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_4
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_5
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_6
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_7
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_8
public void traverse( Object instance, Selector selector, HierarchicalModel<?> model, YogaRequestContext context ) throws IOException { if (instance != null) { if (instance instanceof Iterable) { traverseIterable( (Iterable<?>) instance, selector, (ListHierarchicalModel<?>) model, context ); } else if (instance instanceof Map) { traverseMap( (Map<?,?>) instance, selector, (MapHierarchicalModel<?>) model, context ); } else { traversePojo( instance, selector, (MapHierarchicalModel<?>) model, context ); } } else { model.finished(); } }
1592475_9
public void setMetaDataRegistry( MetaDataRegistry metaDataRegistry ) { this._metaDataRegistry = metaDataRegistry; }
1595052_0
protected String getJdbcManagerComponentName(String name) { String jmName = name; if (StringUtil.isEmpty(jmName)) { return "jdbcManager"; } return jmName + "JdbcManager"; }
1595052_1
@Override public String getJdbcManagerName() { String name = jdbcManagerName.get(); if (! isValidSlaveJdbcManagerName(name)) { name = getMasterJdbcManagerName(); } return name; }
1595052_2
@Override public void useSlave() { for (String name : masterSlaveJdbcManagerFactoryNames) { useSlave(name); } }
1595052_3
@Override public void useMaster() { for (String name : masterSlaveJdbcManagerFactoryNames) { useMaster(name); } }
1595052_4
@Override public boolean isSlave() { boolean slave = true; for (String name : masterSlaveJdbcManagerFactoryNames) { slave &= isSlave(name); } return slave; }
1595052_5
@Override public boolean isMaster() { boolean master = true; for (String name : masterSlaveJdbcManagerFactoryNames) { master &= isMaster(name); } return master; }