_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q178200
Granularity.granularityFromPointsLessThanEqual
test
private static Granularity granularityFromPointsLessThanEqual(double requestedDuration, int points, long assumedIntervalMillis) { Granularity gran = granularityFromPointsLinear(requestedDuration, points, assumedIntervalMillis); if (requestedDuration / gran.milliseconds() > points) { try { gran = gran.coarser(); } catch (GranularityException e) { /* do nothing, already at 1440m */ } } return gran; }
java
{ "resource": "" }
q178201
RollupService.setServerTime
test
public synchronized void setServerTime(long millis) { log.info("Manually setting server time to {} {}", millis, new java.util.Date(millis)); context.setCurrentTimeMillis(millis); }
java
{ "resource": "" }
q178202
IOConfig.getUniqueHosts
test
public Set<String> getUniqueHosts() { Set<String> uniqueHosts = new HashSet<String>(); Collections.addAll(uniqueHosts, config.getStringProperty(CoreConfig.CASSANDRA_HOSTS).split(",")); return uniqueHosts; }
java
{ "resource": "" }
q178203
IOConfig.getMaxConnPerHost
test
public int getMaxConnPerHost(int numHosts) { int maxConns = config.getIntegerProperty(CoreConfig.MAX_CASSANDRA_CONNECTIONS); return maxConns / numHosts + (maxConns % numHosts == 0 ? 0 : 1); }
java
{ "resource": "" }
q178204
CassandraModel.getMetricColumnFamilies
test
public static Iterable<MetricColumnFamily> getMetricColumnFamilies() { return new Iterable<MetricColumnFamily>() { @Override public Iterator<MetricColumnFamily> iterator() { return new Iterator<MetricColumnFamily>() { private int pos = 0; @Override public boolean hasNext() { return pos < METRIC_COLUMN_FAMILES.length; } @Override public MetricColumnFamily next() { return METRIC_COLUMN_FAMILES[pos++]; } @Override public void remove() { throw new NoSuchMethodError("Not implemented"); } }; } }; }
java
{ "resource": "" }
q178205
APreaggregatedMetricsRW.insertMetrics
test
@Override public void insertMetrics(Collection<IMetric> metrics) throws IOException { insertMetrics(metrics, Granularity.FULL); }
java
{ "resource": "" }
q178206
APreaggregatedMetricsRW.insertMetrics
test
@Override public void insertMetrics(Collection<IMetric> metrics, Granularity granularity) throws IOException { try { AstyanaxWriter.getInstance().insertMetrics(metrics, CassandraModel.getPreaggregatedColumnFamily(granularity), isRecordingDelayedMetrics, clock); } catch (ConnectionException ex) { throw new IOException(ex); } }
java
{ "resource": "" }
q178207
LocatorFetchRunnable.getLocators
test
protected Set<Locator> getLocators(RollupExecutionContext executionContext, boolean isReroll, Granularity delayedMetricsRerollGranularity, Granularity delayedMetricsStorageGranularity) { Set<Locator> locators = new HashSet<Locator>(); //if delayed metric tracking is enabled, if its re-roll, if slot granularity is no coarser than // DELAYED_METRICS_REROLL_GRANULARITY, get delayed locators if (RECORD_DELAYED_METRICS && isReroll && !getGranularity().isCoarser(delayedMetricsRerollGranularity)) { if (getGranularity().isCoarser(delayedMetricsStorageGranularity)) { // For example, if we are re-rolling a 60m slot, and we store delayed metrics at 20m, we need to // grab delayed metrics for 3 * 20m slots corresponding to the 60m slot. for (SlotKey slotKey: parentSlotKey.getChildrenKeys(delayedMetricsStorageGranularity)) { locators.addAll(getDelayedLocators(executionContext, slotKey)); } } else { locators = getDelayedLocators(executionContext, parentSlotKey.extrapolate(delayedMetricsStorageGranularity)); } } else { locators = getLocators(executionContext); } return locators; }
java
{ "resource": "" }
q178208
AbstractElasticIO.getMetricNamesFromES
test
private String getMetricNamesFromES(final String tenant, final String regexMetricName) throws IOException { String metricNamesFromElasticsearchQueryString = String.format(queryToFetchMetricNamesFromElasticsearchFormat, tenant, regexMetricName, regexMetricName); return elasticsearchRestHelper.fetchDocuments( ELASTICSEARCH_INDEX_NAME_READ, ELASTICSEARCH_DOCUMENT_TYPE, tenant, metricNamesFromElasticsearchQueryString); }
java
{ "resource": "" }
q178209
AbstractElasticIO.regexToGrabCurrentAndNextLevel
test
protected String regexToGrabCurrentAndNextLevel(final String query) { if (StringUtils.isEmpty(query)) { throw new IllegalArgumentException("Query(glob) string cannot be null/empty"); } String queryRegex = getRegex(query); int totalQueryTokens = getTotalTokens(query); if (totalQueryTokens == 1) { // get metric names which matches the given query and have a next level, // Ex: For metric foo.bar.baz.qux, if query=*, we should get foo.bar. We are not // grabbing 0 level as it will give back bar, baz, qux because of the way data is structured. String baseRegex = convertRegexToCaptureUptoNextToken(queryRegex); return baseRegex + METRIC_TOKEN_SEPARATOR_REGEX + REGEX_TO_GRAB_SINGLE_TOKEN; } else { String[] queryRegexParts = queryRegex.split("\\\\."); String queryRegexUptoPrevLevel = StringUtils.join(queryRegexParts, METRIC_TOKEN_SEPARATOR_REGEX, 0, totalQueryTokens - 1); String baseRegex = convertRegexToCaptureUptoNextToken(queryRegexUptoPrevLevel); String queryRegexLastLevel = queryRegexParts[totalQueryTokens - 1]; String lastTokenRegex = convertRegexToCaptureUptoNextToken(queryRegexLastLevel); // Ex: For metric foo.bar.baz.qux.xxx, if query=foo.bar.b*, get foo.bar.baz, foo.bar.baz.qux // In this case baseRegex = "foo.bar", lastTokenRegex = "b[^.]*"' and the final // regex is foo\.bar\.b[^.]*(\.[^.]*){0,1} return baseRegex + METRIC_TOKEN_SEPARATOR_REGEX + lastTokenRegex + "(" + METRIC_TOKEN_SEPARATOR_REGEX + REGEX_TO_GRAB_SINGLE_TOKEN + ")" + "{0,1}"; } }
java
{ "resource": "" }
q178210
StorageManager.start
test
public synchronized void start() { if (uploaderThread != null) { throw new RuntimeException("StorageManager is already started"); } fileUploader = new DoneFileUploader(); uploaderThread = new Thread(fileUploader, "StorageManager uploader"); uploaderThread.start(); }
java
{ "resource": "" }
q178211
StorageManager.stop
test
public synchronized void stop() throws IOException { if (uploaderThread == null) { throw new RuntimeException("Not running"); } uploaderThread.interrupt(); uploaderThread = null; fileUploader.shutdown(); }
java
{ "resource": "" }
q178212
LocatorCache.isLocatorCurrentInBatchLayer
test
public synchronized boolean isLocatorCurrentInBatchLayer(Locator loc) { LocatorCacheEntry entry = insertedLocators.getIfPresent(loc.toString()); return entry != null && entry.isBatchCurrent(); }
java
{ "resource": "" }
q178213
LocatorCache.isLocatorCurrentInDiscoveryLayer
test
public synchronized boolean isLocatorCurrentInDiscoveryLayer(Locator loc) { LocatorCacheEntry entry = insertedLocators.getIfPresent(loc.toString()); return entry != null && entry.isDiscoveryCurrent(); }
java
{ "resource": "" }
q178214
LocatorCache.isLocatorCurrentInTokenDiscoveryLayer
test
public synchronized boolean isLocatorCurrentInTokenDiscoveryLayer(Locator loc) { LocatorCacheEntry entry = insertedLocators.getIfPresent(loc.toString()); return entry != null && entry.isTokenDiscoveryCurrent(); }
java
{ "resource": "" }
q178215
LocatorCache.isDelayedLocatorForASlotCurrent
test
public synchronized boolean isDelayedLocatorForASlotCurrent(int slot, Locator locator) { return insertedDelayedLocators.getIfPresent(getLocatorSlotKey(slot, locator)) != null; }
java
{ "resource": "" }
q178216
LocatorCache.setDelayedLocatorForASlotCurrent
test
public synchronized void setDelayedLocatorForASlotCurrent(int slot, Locator locator) { insertedDelayedLocators.put(getLocatorSlotKey(slot, locator), Boolean.TRUE); }
java
{ "resource": "" }
q178217
Range.mapFinerRanges
test
public static Map<Range, Iterable<Range>> mapFinerRanges(Granularity g, Range range) throws GranularityException { if(range.getStart() >= range.getStop()) throw new IllegalArgumentException("start cannot be greater than end. Start: " + range.getStart() + " Stop:" + range.getStop()); final long snappedStartMillis = g.snapMillis(range.getStart()); final long snappedStopMillis = g.snapMillis(range.getStop() + g.milliseconds()); HashMap<Range, Iterable<Range>> rangeMap = new HashMap<Range, Iterable<Range>>(); long tempStartMillis = snappedStartMillis; int numberOfMillis = g.milliseconds(); while (tempStartMillis <= (snappedStopMillis - numberOfMillis)) { Range slotRange = new Range(tempStartMillis, tempStartMillis + numberOfMillis); rangeMap.put(slotRange, new IntervalRangeIterator(g.finer(), slotRange.start, slotRange.stop)); tempStartMillis = tempStartMillis + numberOfMillis; } return rangeMap; }
java
{ "resource": "" }
q178218
Range.rangesForInterval
test
public static Iterable<Range> rangesForInterval(Granularity g, final long from, final long to) { if (g == Granularity.FULL) { return Arrays.asList(new Range(from, to)); } final long snappedStartMillis = g.snapMillis(from); final long snappedStopMillis = g.snapMillis(to + g.milliseconds()); return new IntervalRangeIterator(g, snappedStartMillis, snappedStopMillis); }
java
{ "resource": "" }
q178219
AstyanaxWriter.insertFull
test
public void insertFull(Collection<? extends IMetric> metrics, boolean isRecordingDelayedMetrics, Clock clock) throws ConnectionException { Timer.Context ctx = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_FULL_NAME); try { MutationBatch mutationBatch = keyspace.prepareMutationBatch(); for (IMetric metric: metrics) { final Locator locator = metric.getLocator(); // key = shard // col = locator (acct + entity + check + dimension.metric) // value = <nothing> if (!LocatorCache.getInstance().isLocatorCurrentInBatchLayer(locator)) { if (mutationBatch != null) insertLocator(locator, mutationBatch); LocatorCache.getInstance().setLocatorCurrentInBatchLayer(locator); } if (isRecordingDelayedMetrics) { //retaining the same conditional logic that was used to insertLocator(locator, batch) above. if (mutationBatch != null) { insertLocatorIfDelayed(metric, mutationBatch, clock); } } insertMetric(metric, mutationBatch); Instrumentation.markFullResMetricWritten(); } // insert it try { mutationBatch.execute(); } catch (ConnectionException e) { Instrumentation.markWriteError(e); log.error("Connection exception during insertFull", e); throw e; } } finally { ctx.stop(); } }
java
{ "resource": "" }
q178220
AstyanaxWriter.insertMetrics
test
public void insertMetrics(Collection<IMetric> metrics, ColumnFamily cf, boolean isRecordingDelayedMetrics, Clock clock) throws ConnectionException { Timer.Context ctx = Instrumentation.getWriteTimerContext(cf.getName()); Multimap<Locator, IMetric> map = asMultimap(metrics); MutationBatch batch = keyspace.prepareMutationBatch(); try { for (Locator locator : map.keySet()) { ColumnListMutation<Long> mutation = batch.withRow(cf, locator); for (IMetric metric : map.get(locator)) { mutation.putColumn( metric.getCollectionTime(), metric.getMetricValue(), (AbstractSerializer) (Serializers.serializerFor(metric.getMetricValue().getClass())), metric.getTtlInSeconds()); if (cf.getName().equals(CassandraModel.CF_METRICS_PREAGGREGATED_FULL_NAME)) { Instrumentation.markFullResPreaggregatedMetricWritten(); } if (isRecordingDelayedMetrics) { //retaining the same conditional logic that was used to perform insertLocator(locator, batch). insertLocatorIfDelayed(metric, batch, clock); } } if (!LocatorCache.getInstance().isLocatorCurrentInBatchLayer(locator)) { insertLocator(locator, batch); LocatorCache.getInstance().setLocatorCurrentInBatchLayer(locator); } } try { batch.execute(); } catch (ConnectionException e) { Instrumentation.markWriteError(e); log.error("Connection exception persisting data", e); throw e; } } finally { ctx.stop(); } }
java
{ "resource": "" }
q178221
DAbstractMetricsRW.isDelayed
test
protected boolean isDelayed(IMetric metric) { long delay = clock.now().getMillis() - metric.getCollectionTime(); return delay > MAX_AGE_ALLOWED; }
java
{ "resource": "" }
q178222
DAbstractMetricsRW.getBoundStatementForMetricIfDelayed
test
protected BoundStatement getBoundStatementForMetricIfDelayed(IMetric metric) { Locator locator = metric.getLocator(); if ( isDelayed(metric) ) { int slot = getDelayedSlot(metric); if (!LocatorCache.getInstance().isDelayedLocatorForASlotCurrent(slot, locator)) { LocatorCache.getInstance().setDelayedLocatorForASlotCurrent(slot, locator); return delayedLocatorIO.getBoundStatementForLocator(DELAYED_METRICS_STORAGE_GRANULARITY, slot, locator); } } return null; }
java
{ "resource": "" }
q178223
AstyanaxReader.getMetadataValues
test
public Map<String, String> getMetadataValues(Locator locator) { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_METADATA_NAME); try { final ColumnList<String> results = keyspace.prepareQuery(CassandraModel.CF_METRICS_METADATA) .getKey(locator) .execute().getResult(); return new HashMap<String, String>(){{ for (Column<String> result : results) { put(result.getName(), result.getValue(StringMetadataSerializer.get())); } }}; } catch (NotFoundException ex) { Instrumentation.markNotFound(CassandraModel.CF_METRICS_METADATA_NAME); return null; } catch (ConnectionException e) { log.error("Error reading metadata value", e); Instrumentation.markReadError(e); throw new RuntimeException(e); } finally { ctx.stop(); } }
java
{ "resource": "" }
q178224
Serializers.serializerFor
test
public static <T> AbstractSerializer<T> serializerFor(Class<T> type) { if (type == null) throw new RuntimeException("serializable type cannot be null", new SerializationException("serializable type cannot be null")); else if (type.equals(String.class)) throw new RuntimeException("We don't serialize strings anymore", new SerializationException("We don't serialize strings anymore")); if (type.equals(BasicRollup.class)) return (AbstractSerializer<T>) basicRollupInstance; else if (type.equals(BluefloodTimerRollup.class)) return (AbstractSerializer<T>)timerRollupInstance; else if (type.equals(BluefloodCounterRollup.class)) return (AbstractSerializer<T>) counterRollupInstance; else if (type.equals(BluefloodGaugeRollup.class)) return (AbstractSerializer<T>)gaugeRollupInstance; else if (type.equals(BluefloodSetRollup.class)) return (AbstractSerializer<T>)setRollupInstance; else if (type.equals(SimpleNumber.class)) return (AbstractSerializer<T>)fullInstance; else if (type.equals(Integer.class)) return (AbstractSerializer<T>)fullInstance; else if (type.equals(Long.class)) return (AbstractSerializer<T>)fullInstance; else if (type.equals(Double.class)) return (AbstractSerializer<T>)fullInstance; else if (type.equals(Float.class)) return (AbstractSerializer<T>)fullInstance; else if (type.equals(byte[].class)) return (AbstractSerializer<T>)fullInstance; else if (type.equals(Object.class)) return (AbstractSerializer<T>)fullInstance; else return (AbstractSerializer<T>)fullInstance; }
java
{ "resource": "" }
q178225
MediaTypeChecker.isContentTypeValid
test
public boolean isContentTypeValid(HttpHeaders headers) { String contentType = headers.get(HttpHeaders.Names.CONTENT_TYPE); // if we get no Content-Type or we get application/json, then it's valid // any other, it's invalid return (Strings.isNullOrEmpty(contentType) || contentType.toLowerCase().contains(MEDIA_TYPE_APPLICATION_JSON)); }
java
{ "resource": "" }
q178226
MediaTypeChecker.isAcceptValid
test
public boolean isAcceptValid(HttpHeaders headers) { String accept = headers.get(HttpHeaders.Names.ACCEPT); // if we get no Accept (which means */*), or */*, // or application/json, then it's valid return ( Strings.isNullOrEmpty(accept) || accept.contains(ACCEPT_ALL) || accept.toLowerCase().contains(MEDIA_TYPE_APPLICATION_JSON)); }
java
{ "resource": "" }
q178227
ElasticIO.insertDiscovery
test
public void insertDiscovery(List<IMetric> batch) throws IOException { batchHistogram.update(batch.size()); if (batch.size() == 0) { log.debug("ElasticIO: batch size for insertDiscovery is zero, so skip calling Elasticsearch ingest."); return; } Timer.Context ctx = writeTimer.time(); try { for (Object obj : batch) { if (!(obj instanceof IMetric)) { classCastExceptionMeter.mark(); continue; } } elasticsearchRestHelper.indexMetrics(batch); } finally { ctx.stop(); } }
java
{ "resource": "" }
q178228
AggregatedPayload.isValid
test
@AssertTrue(message="At least one of the aggregated metrics(gauges, counters, timers, sets) are expected") private boolean isValid() { boolean isGaugePresent = gauges != null && gauges.length > 0; boolean isCounterPresent = counters != null && counters.length > 0; boolean isTimerPresent = timers != null && timers.length > 0; boolean isSetPresent = sets != null && sets.length > 0; return (isGaugePresent || isCounterPresent || isTimerPresent || isSetPresent); }
java
{ "resource": "" }
q178229
DownloadService.doCheck
test
private void doCheck() { if (!running) return; if (fileManager == null) return; if (unexpectedErrors > MAX_UNEXPECTED_ERRORS) { log.info("Terminating because of errors"); terminate(false); return; } Timer.Context waitTimerContext = waitingTimer.time(); // Possible infinite thread sleep? This will make sure we fire downloading only when are the files are consumed/merged while (downloadDir.listFiles().length != 0) { log.debug("Waiting for files in download directory to clear up. Sleeping for 1 min. If you see this persistently, it means the downloaded files are not getting merged properly/timely"); try { Thread.sleep(60000); } catch (Exception ex) {} } waitTimerContext.stop(); if (downloadLock.tryLock()) { try { if (fileManager.hasNewFiles()) { fileManager.downloadNewFiles(downloadDir); } } catch (Throwable unexpected) { unexpectedErrors += 1; log.error("UNEXPECTED; WILL TRY TO RECOVER"); log.error(unexpected.getMessage(), unexpected); // sleep for a minute? if (Thread.interrupted()) { try { thread.sleep(60000); } catch (Exception ex) { log.error(ex.getMessage(), ex); } } } finally { downloadLock.unlock(); } } else { log.debug("Download in progress"); } }
java
{ "resource": "" }
q178230
ExtractorFactory.getNewInstance
test
public Extractor getNewInstance() { Extractor extractor = new BasicExtractor(config); if (config.shouldCachedDownload()) { extractor = new CachedExtractor(extractor, config); } return extractor; }
java
{ "resource": "" }
q178231
SystemUtils.getOSMatches
test
private static boolean getOSMatches(final String osNamePrefix, final String osVersionPrefix) { return isOSMatch(OS_NAME, OS_VERSION, osNamePrefix, osVersionPrefix); }
java
{ "resource": "" }
q178232
EmbeddedRabbitMq.start
test
public void start() throws ErlangVersionException, DownloadException, ExtractionException, StartupException { if (rabbitMqProcess != null) { throw new IllegalStateException("Start shouldn't be called more than once unless stop() has been called before."); } check(); download(); extract(); run(); }
java
{ "resource": "" }
q178233
EmbeddedRabbitMq.stop
test
public void stop() throws ShutDownException { if (rabbitMqProcess == null) { throw new IllegalStateException("Stop shouldn't be called unless 'start()' was successful."); } new ShutdownHelper(config, rabbitMqProcess).run(); rabbitMqProcess = null; }
java
{ "resource": "" }
q178234
PnSignalingParams.defaultInstance
test
public static PnSignalingParams defaultInstance() { MediaConstraints pcConstraints = PnSignalingParams.defaultPcConstraints(); MediaConstraints videoConstraints = PnSignalingParams.defaultVideoConstraints(); MediaConstraints audioConstraints = PnSignalingParams.defaultAudioConstraints(); List<PeerConnection.IceServer> iceServers = PnSignalingParams.defaultIceServers(); return new PnSignalingParams(iceServers, pcConstraints, videoConstraints, audioConstraints); }
java
{ "resource": "" }
q178235
PnSignalingParams.addIceServers
test
public void addIceServers(List<PeerConnection.IceServer> iceServers){ if(this.iceServers!=null) { iceServers.addAll(this.iceServers); } this.iceServers = iceServers; }
java
{ "resource": "" }
q178236
PnSignalingParams.addIceServers
test
public void addIceServers(PeerConnection.IceServer iceServers){ if (this.iceServers == null){ this.iceServers = new ArrayList<PeerConnection.IceServer>(); } this.iceServers.add(0, iceServers); }
java
{ "resource": "" }
q178237
PnRTCClient.transmit
test
public void transmit(String userId, JSONObject message){ JSONObject usrMsgJson = new JSONObject(); try { usrMsgJson.put(PnRTCMessage.JSON_USERMSG, message); this.pcClient.transmitMessage(userId, usrMsgJson); } catch (JSONException e){ e.printStackTrace(); } }
java
{ "resource": "" }
q178238
PnRTCClient.transmitAll
test
public void transmitAll(JSONObject message){ List<PnPeer> peerList = this.pcClient.getPeers(); for(PnPeer p : peerList){ transmit(p.getId(), message); } }
java
{ "resource": "" }
q178239
Immobilie.getWeitereAdresse
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<WeitereAdresse> getWeitereAdresse() { if (weitereAdresse == null) { weitereAdresse = new ArrayList<WeitereAdresse>(); } return this.weitereAdresse; }
java
{ "resource": "" }
q178240
Immobilie.getUserDefinedSimplefield
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<UserDefinedSimplefield> getUserDefinedSimplefield() { if (userDefinedSimplefield == null) { userDefinedSimplefield = new ArrayList<UserDefinedSimplefield>(); } return this.userDefinedSimplefield; }
java
{ "resource": "" }
q178241
Immobilie.getUserDefinedAnyfield
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<UserDefinedAnyfield> getUserDefinedAnyfield() { if (userDefinedAnyfield == null) { userDefinedAnyfield = new ArrayList<UserDefinedAnyfield>(); } return this.userDefinedAnyfield; }
java
{ "resource": "" }
q178242
ImmobilieBaseTyp.setApiSuchfelder
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setApiSuchfelder(JAXBElement<ApiSuchfelderTyp> value) { this.apiSuchfelder = value; }
java
{ "resource": "" }
q178243
ImmobilieBaseTyp.getMultimediaAnhang
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public List<MultimediaAnhangTyp> getMultimediaAnhang() { if (multimediaAnhang == null) { multimediaAnhang = new ArrayList<MultimediaAnhangTyp>(); } return this.multimediaAnhang; }
java
{ "resource": "" }
q178244
ImmobilieBaseTyp.getStatusVBM
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public StatusTyp getStatusVBM() { if (statusVBM == null) { return StatusTyp.AKTIV; } else { return statusVBM; } }
java
{ "resource": "" }
q178245
ImmobilieBaseTyp.getStatusIS24
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public StatusTyp getStatusIS24() { if (statusIS24 == null) { return StatusTyp.AKTIV; } else { return statusIS24; } }
java
{ "resource": "" }
q178246
ImmobilieBaseTyp.getStatusHP
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public StatusTyp getStatusHP() { if (statusHP == null) { return StatusTyp.AKTIV; } else { return statusHP; } }
java
{ "resource": "" }
q178247
ImmobilieBaseTyp.getImportmodus
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public AktionsTyp getImportmodus() { if (importmodus == null) { return AktionsTyp.IMPORTIEREN; } else { return importmodus; } }
java
{ "resource": "" }
q178248
ImmobilieBaseTyp.getAdressdruck
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public Boolean getAdressdruck() { if (adressdruck == null) { return false; } else { return adressdruck; } }
java
{ "resource": "" }
q178249
ImmobilieBaseTyp.getWaehrung
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public WaehrungTyp getWaehrung() { if (waehrung == null) { return WaehrungTyp.EUR; } else { return waehrung; } }
java
{ "resource": "" }
q178250
SonstigeGewerbeTyp.getBodenbelag
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public BodenbelagTyp getBodenbelag() { if (bodenbelag == null) { return BodenbelagTyp.KEINE_ANGABE; } else { return bodenbelag; } }
java
{ "resource": "" }
q178251
OverseasRentalAdType.setRegion
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setRegion(java.lang.String value) { this.region = value; }
java
{ "resource": "" }
q178252
OverseasRentalAdType.setArea
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setArea(java.lang.String value) { this.area = value; }
java
{ "resource": "" }
q178253
OverseasRentalAdType.setAddress
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setAddress(java.lang.String value) { this.address = value; }
java
{ "resource": "" }
q178254
OverseasRentalAdType.setDescription
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setDescription(java.lang.String value) { this.description = value; }
java
{ "resource": "" }
q178255
OverseasRentalAdType.setRentCollectionPeriod
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setRentCollectionPeriod(OverseasRentalAdType.RentPeriod value) { this.rentCollectionPeriod = value; }
java
{ "resource": "" }
q178256
OverseasRentalAdType.setFurnished
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setFurnished(OverseasRentalAdType.Furnished value) { this.furnished = value; }
java
{ "resource": "" }
q178257
OverseasRentalAdType.setPhone1
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setPhone1(java.lang.String value) { this.phone1 = value; }
java
{ "resource": "" }
q178258
OverseasRentalAdType.setPhone2
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setPhone2(java.lang.String value) { this.phone2 = value; }
java
{ "resource": "" }
q178259
OverseasRentalAdType.setContactName
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setContactName(java.lang.String value) { this.contactName = value; }
java
{ "resource": "" }
q178260
OverseasRentalAdType.setPhoneInfo
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setPhoneInfo(java.lang.String value) { this.phoneInfo = value; }
java
{ "resource": "" }
q178261
OverseasRentalAdType.setMainEmail
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setMainEmail(java.lang.String value) { this.mainEmail = value; }
java
{ "resource": "" }
q178262
OverseasRentalAdType.setCcEmail
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setCcEmail(java.lang.String value) { this.ccEmail = value; }
java
{ "resource": "" }
q178263
OverseasRentalAdType.setExternalId
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setExternalId(java.lang.String value) { this.externalId = value; }
java
{ "resource": "" }
q178264
OverseasRentalAdType.setAgentId
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public void setAgentId(java.lang.String value) { this.agentId = value; }
java
{ "resource": "" }
q178265
Energiepass.setEpart
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setEpart(Energiepass.Epart value) { this.epart = value; }
java
{ "resource": "" }
q178266
Energiepass.setJahrgang
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setJahrgang(Energiepass.Jahrgang value) { this.jahrgang = value; }
java
{ "resource": "" }
q178267
Energiepass.setGebaeudeart
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setGebaeudeart(Energiepass.Gebaeudeart value) { this.gebaeudeart = value; }
java
{ "resource": "" }
q178268
BueroPraxen.setBueroTyp
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setBueroTyp(BueroPraxen.BueroTyp value) { this.bueroTyp = value; }
java
{ "resource": "" }
q178269
NumberUtils.isNumeric
test
public static boolean isNumeric(String value, Locale locale) { if (value == null) return false; int start = 0; final DecimalFormatSymbols symbols = (locale != null) ? DecimalFormatSymbols.getInstance(locale) : DecimalFormatSymbols.getInstance(); if (value.startsWith("+") || value.startsWith("-")) start++; boolean fraction = false; for (int i = start; i < value.length(); i++) { final char c = value.charAt(i); if (c == symbols.getDecimalSeparator() && !fraction) { fraction = true; continue; } if (c == symbols.getGroupingSeparator() && !fraction) { continue; } if (!Character.isDigit(c)) { return false; } } return true; }
java
{ "resource": "" }
q178270
LageGebiet.setGebiete
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public void setGebiete(LageGebiet.Gebiete value) { this.gebiete = value; }
java
{ "resource": "" }
q178271
Anhang.setGruppe
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public void setGruppe(Anhang.Gruppe value) { this.gruppe = value; }
java
{ "resource": "" }
q178272
Root.setAgent
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T01:43:04+02:00", comments = "JAXB RI v2.2.11") public void setAgent(Root.Agent value) { this.agent = value; }
java
{ "resource": "" }
q178273
Root.getProperty
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T01:43:04+02:00", comments = "JAXB RI v2.2.11") public List<PropertyType> getProperty() { if (property == null) { property = new ArrayList<PropertyType>(); } return this.property; }
java
{ "resource": "" }
q178274
Verkaufstatus.setStand
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setStand(Verkaufstatus.Stand value) { this.stand = value; }
java
{ "resource": "" }
q178275
Kontaktperson.getUserDefinedExtend
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public List<UserDefinedExtend> getUserDefinedExtend() { if (userDefinedExtend == null) { userDefinedExtend = new ArrayList<UserDefinedExtend>(); } return this.userDefinedExtend; }
java
{ "resource": "" }
q178276
PreisZeiteinheit.setZeiteinheit
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setZeiteinheit(PreisZeiteinheit.Zeiteinheit value) { this.zeiteinheit = value; }
java
{ "resource": "" }
q178277
Objektart.getZimmer
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Zimmer> getZimmer() { if (zimmer == null) { zimmer = new ArrayList<Zimmer>(); } return this.zimmer; }
java
{ "resource": "" }
q178278
Objektart.getHaus
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Haus> getHaus() { if (haus == null) { haus = new ArrayList<Haus>(); } return this.haus; }
java
{ "resource": "" }
q178279
Objektart.getBueroPraxen
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<BueroPraxen> getBueroPraxen() { if (bueroPraxen == null) { bueroPraxen = new ArrayList<BueroPraxen>(); } return this.bueroPraxen; }
java
{ "resource": "" }
q178280
Objektart.getGastgewerbe
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Gastgewerbe> getGastgewerbe() { if (gastgewerbe == null) { gastgewerbe = new ArrayList<Gastgewerbe>(); } return this.gastgewerbe; }
java
{ "resource": "" }
q178281
Objektart.getLandUndForstwirtschaft
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<LandUndForstwirtschaft> getLandUndForstwirtschaft() { if (landUndForstwirtschaft == null) { landUndForstwirtschaft = new ArrayList<LandUndForstwirtschaft>(); } return this.landUndForstwirtschaft; }
java
{ "resource": "" }
q178282
Objektart.getSonstige
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Sonstige> getSonstige() { if (sonstige == null) { sonstige = new ArrayList<Sonstige>(); } return this.sonstige; }
java
{ "resource": "" }
q178283
Objektart.getZinshausRenditeobjekt
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<ZinshausRenditeobjekt> getZinshausRenditeobjekt() { if (zinshausRenditeobjekt == null) { zinshausRenditeobjekt = new ArrayList<ZinshausRenditeobjekt>(); } return this.zinshausRenditeobjekt; }
java
{ "resource": "" }
q178284
Terrains.getTerrain
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11") public List<TerrainType> getTerrain() { if (terrain == null) { terrain = new ArrayList<TerrainType>(); } return this.terrain; }
java
{ "resource": "" }
q178285
Uebertragung.setUmfang
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public void setUmfang(Uebertragung.Umfang value) { this.umfang = value; }
java
{ "resource": "" }
q178286
Wohnung.setWohnungtyp
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11") public void setWohnungtyp(Wohnung.Wohnungtyp value) { this.wohnungtyp = value; }
java
{ "resource": "" }
q178287
LocaleUtils.getCountryISO2
test
public static String getCountryISO2(String country) { country = StringUtils.trimToNull(country); if (country == null) return null; if (country.length() == 2) return country; String[] iso2Codes = Locale.getISOCountries(); if (country.length() == 3) { String iso2Code = LocaleUtils.getCountryISO2FromISO3(country); if (iso2Code != null) return iso2Code; } for (String iso2Code : iso2Codes) { Locale countryLocale = new Locale(iso2Code, iso2Code); for (Locale translationLocale : LocaleUtils.availableLocaleList()) { String name = StringUtils.trimToNull(countryLocale.getDisplayCountry(translationLocale)); if (name != null && name.equalsIgnoreCase(country)) return iso2Code; } } return null; }
java
{ "resource": "" }
q178288
LocaleUtils.getCountryISO2FromISO3
test
public static String getCountryISO2FromISO3(String iso3Code) { iso3Code = StringUtils.trimToNull(iso3Code); if (iso3Code == null) return null; if (iso3Code.length() == 3) { for (String iso2Code : Locale.getISOCountries()) { Locale countryLocale = new Locale(iso2Code, iso2Code); String countryISO3 = StringUtils.trimToNull(countryLocale.getISO3Country()); if (countryISO3 != null && countryISO3.equalsIgnoreCase(iso3Code)) { return iso2Code; } } } return null; }
java
{ "resource": "" }
q178289
LocaleUtils.getCountryISO3
test
public static String getCountryISO3(String country) { country = StringUtils.trimToNull(country); if (country == null) return null; if (country.length() == 3) return country; String[] iso2Codes = Locale.getISOCountries(); if (country.length() == 2) { String iso3code = LocaleUtils.getCountryISO3FromISO2(country); if (iso3code != null) return iso3code; } for (String iso2Code : iso2Codes) { Locale countryLocale = new Locale(iso2Code, iso2Code); String iso3Code = StringUtils.trimToNull(countryLocale.getISO3Country()); if (iso3Code == null) continue; for (Locale translationLocale : LocaleUtils.availableLocaleList()) { String name = StringUtils.trimToNull(countryLocale.getDisplayCountry(translationLocale)); if (name != null && name.equalsIgnoreCase(country)) return iso3Code; } } return null; }
java
{ "resource": "" }
q178290
LocaleUtils.getCountryISO3FromISO2
test
public static String getCountryISO3FromISO2(String iso2Code) { iso2Code = StringUtils.trimToNull(iso2Code); if (iso2Code == null) return null; if (iso2Code.length() == 2) { Locale countryLocale = new Locale(iso2Code, iso2Code); String iso3Code = StringUtils.trimToNull(countryLocale.getISO3Country()); if (iso3Code != null) return iso3Code; } return null; }
java
{ "resource": "" }
q178291
LocaleUtils.getCountryName
test
public static String getCountryName(String country, Locale language) { country = StringUtils.trimToNull(country); if (country == null) return null; String iso2Code = LocaleUtils.getCountryISO2(country); if (iso2Code != null) { String name = StringUtils.trimToNull( new Locale(iso2Code, iso2Code).getDisplayCountry(language)); if (name != null) return name; } return null; }
java
{ "resource": "" }
q178292
LocaleUtils.translateCountryName
test
public static String translateCountryName(String country, Locale language) { country = StringUtils.trimToNull(country); if (country == null) return null; for (String iso2Code : Locale.getISOCountries()) { Locale countryLocale = new Locale(iso2Code, iso2Code); for (Locale translationLocale : LocaleUtils.availableLocaleList()) { String name = StringUtils.trimToNull(countryLocale.getDisplayCountry(translationLocale)); if (name != null && name.equalsIgnoreCase(country)) { name = StringUtils.trimToNull(countryLocale.getDisplayCountry(language)); if (name != null) return name; } } } return null; }
java
{ "resource": "" }
q178293
Immoxml.getAnbieter
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Anbieter> getAnbieter() { if (anbieter == null) { anbieter = new ArrayList<Anbieter>(); } return this.anbieter; }
java
{ "resource": "" }
q178294
BusinessElement.setCategory
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:48:12+02:00", comments = "JAXB RI v2.2.11") public void setCategory(BusinessElement.BusinessElementCategory value) { this.category = value; }
java
{ "resource": "" }
q178295
PdfsType.getPdf
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:42+02:00", comments = "JAXB RI v2.2.11") public List<URI> getPdf() { if (pdf == null) { pdf = new ArrayList<URI>(); } return this.pdf; }
java
{ "resource": "" }
q178296
Aktion.setAktionart
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public void setAktionart(Aktion.AktionArt value) { this.aktionart = value; }
java
{ "resource": "" }
q178297
Container.setRealestateitems
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:41:02+02:00", comments = "JAXB RI v2.2.11") public void setRealestateitems(Container.Realestateitems value) { this.realestateitems = value; }
java
{ "resource": "" }
q178298
VermarktungGrundstueckWohnenMieteTyp.setPacht
test
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setPacht(JAXBElement<VermarktungGrundstueckWohnenMieteTyp.Pacht> value) { this.pacht = value; }
java
{ "resource": "" }
q178299
OpenImmo_1_2_7.downgradeToPreviousVersion
test
@Override public void downgradeToPreviousVersion(OpenImmoDocument doc) { doc.setDocumentVersion(OpenImmoVersion.V1_2_6); if (doc instanceof OpenImmoTransferDocument) { try { this.removeMultipleEnergiepassElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove odd <energiepass> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.removeObjektTextElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't remove unsupported <objekt_text> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeSummemietenettoElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <summemietenetto> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeBefeuerungElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <befeuerung> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeAnhangElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <anhang> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeAktionElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <aktion> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } try { this.downgradeEnergiepassElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <energiepass> elements!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); } } }
java
{ "resource": "" }