method2testcases stringlengths 118 6.63k |
|---|
### Question:
AllIntegersArguments { @Option("opt") abstract Optional<Integer> optionalInteger(); }### Answer:
@Test void optionalInteger() { f.assertThat("--opt", "1", "--obj=1", "--prim=1").succeeds( "positional", emptyList(), "listOfIntegers", emptyList(), "optionalInteger", Optional.of(1), "integer", 1, "primiti... |
### Question:
AllIntegersArguments { @Param(1) abstract List<Integer> positional(); }### Answer:
@Test void positional() { f.assertThat("--obj=1", "--prim=1", "5", "3").succeeds( "positional", asList(5, 3), "listOfIntegers", emptyList(), "optionalInteger", Optional.empty(), "integer", 1, "primitiveInt", 1); } |
### Question:
Optionalish { static Optional<Optionalish> unwrap(TypeMirror type, TypeTool tool) { Optional<Optionalish> optionalPrimtive = getOptionalPrimitive(type, tool); if (optionalPrimtive.isPresent()) { return optionalPrimtive; } return tool.unwrap(Optional.class, type) .map(wrapped -> new Optionalish(p -> CodeBl... |
### Question:
ReferenceTool { public ReferencedType<E> getReferencedType() { return resolver.typecheck(referencedClass, Supplier.class) .fold(this::handleNotSupplier, this::handleSupplier); } ReferenceTool(ExpectedType<E> expectedType, Function<String, ValidationException> errorHandler, TypeTool tool, TypeElement refer... |
### Question:
Resolver { <E> Either<TypecheckFailure, List<? extends TypeMirror>> typecheck(TypeElement dog, Class<E> animal) { List<ImplementsRelation> hierarchy = new HierarchyUtil(tool).getHierarchy(dog); List<ImplementsRelation> path = findPath(hierarchy, animal); if (path.isEmpty()) { return left(nonFatal("not a "... |
### Question:
CollectorClassValidator { CollectorInfo getCollectorInfo() { commonChecks(collectorClass); checkNotAbstract(collectorClass); ReferencedType<Collector> collectorType = new ReferenceTool<>(COLLECTOR, errorHandler, tool, collectorClass) .getReferencedType(); TypeMirror inputType = collectorType.typeArguments... |
### Question:
ExtremelySimpleArguments { @Param(value = 1) abstract int hello(); }### Answer:
@Test void simpleTest() { assertEquals(1, f.parse("1").hello()); } |
### Question:
MapperClassValidator { public Either<String, CodeBlock> getMapExpr() { commonChecks(mapperClass); checkNotAbstract(mapperClass); ReferencedType<Function> functionType = new ReferenceTool<>(FUNCTION, errorHandler, tool, mapperClass).getReferencedType(); TypeMirror inputType = functionType.typeArguments().g... |
### Question:
TypevarMapping { public TypeMirror get(String key) { return map.get(key); } TypevarMapping(Map<String, TypeMirror> map, TypeTool tool); Set<Map.Entry<String, TypeMirror>> entries(); TypeMirror get(String key); Either<TypecheckFailure, TypeMirror> substitute(TypeMirror input); Either<TypecheckFailure, Decl... |
### Question:
TypevarMapping { public Either<TypecheckFailure, TypeMirror> substitute(TypeMirror input) { if (input.getKind() == TypeKind.TYPEVAR) { return right(map.getOrDefault(input.toString(), input)); } if (input.getKind() == TypeKind.ARRAY) { return right(input); } return substitute(input.accept(AS_DECLARED, null... |
### Question:
CustomCollectorArguments { @Option(value = "H", mnemonic = 'H', collectedBy = MyStringCollector.class) abstract Set<String> strings(); }### Answer:
@Test void testNoMapper() { CustomCollectorArguments parsed = f.parse( "-H", "A", "-H", "A", "-H", "HA"); assertEquals(new HashSet<>(asList("A", "HA")), pa... |
### Question:
CustomCollectorArguments { @Option(value = "B", mnemonic = 'B', collectedBy = MyIntegerCollector.class) abstract Set<Integer> integers(); }### Answer:
@Test void testBuiltinMapper() { CustomCollectorArguments parsed = f.parse( "-B", "1", "-B", "1", "-B", "2"); assertEquals(new HashSet<>(asList(1, 2)), ... |
### Question:
CustomCollectorArguments { @Option( value = "M", mnemonic = 'M', mappedBy = CustomBigIntegerMapper.class, collectedBy = ToSetCollector.class) abstract Set<BigInteger> bigIntegers(); }### Answer:
@Test void testCustomMapper() { CustomCollectorArguments parsed = f.parse( "-M", "0x5", "-M", "0xA", "-M", "... |
### Question:
CustomCollectorArguments { @Option(value = "K", mnemonic = 'K', collectedBy = ToSetCollector.class) abstract Set<Giddy> moneySet(); }### Answer:
@Test void testCustomEnum() { CustomCollectorArguments parsed = f.parse( "-K", "SOME", "-K", "NONE"); assertEquals(Stream.of( CustomCollectorArguments.Giddy.S... |
### Question:
CustomCollectorArguments { @Option( value = "T", mnemonic = 'T', mappedBy = MapEntryTokenizer.class, collectedBy = ToMapCollector.class) abstract Map<String, LocalDate> dateMap(); }### Answer:
@Test void testMap() { CustomCollectorArguments parsed = f.parse( "-T", "A:2004-11-11", "-T", "B:2018-11-12");... |
### Question:
ComplicatedMapperArguments { @Option( value = "number", mappedBy = Mapper.class) abstract Integer number(); }### Answer:
@Test void number() { ComplicatedMapperArguments parsed = f.parse( "--number", "12", "--numbers", "3", "--numbers", "oops"); assertEquals(1, parsed.number().intValue()); assertEquals... |
### Question:
AdditionArguments { final int sum() { return a() + b() + c().orElse(0); } }### Answer:
@Test void dashesIgnored() { f.assertThat("--", "1", "-2", "3").satisfies(e -> e.sum() == 2); f.assertThat("--", "-1", "-2", "-3").satisfies(e -> e.sum() == -6); f.assertThat("--", "-1", "-2", "3").satisfies(e -> e.s... |
### Question:
CustomStringSpanName implements QuerySpanNameProvider { CustomStringSpanName(String customString) { if (customString == null) { this.customString = "execute"; } else { this.customString = customString; } } CustomStringSpanName(String customString); @Override String querySpanName(String query); static Buil... |
### Question:
PrefixedFullQuerySpanName implements QuerySpanNameProvider { PrefixedFullQuerySpanName(String prefix) { if (prefix == null || prefix.equals("")) { this.prefix = ""; } else { this.prefix = prefix + ": "; } } PrefixedFullQuerySpanName(String prefix); @Override String querySpanName(String query); static Buil... |
### Question:
FullQuerySpanName implements QuerySpanNameProvider { FullQuerySpanName() { } FullQuerySpanName(); @Override String querySpanName(String query); static Builder newBuilder(); }### Answer:
@Test public void fullQuerySpanNameTest() { QuerySpanNameProvider fullQuerySpanName = FullQuerySpanName.newBuilder().bu... |
### Question:
GuavaCompatibilityUtil { static boolean isGuavaCompatibilityFound() { return INSTANCE.isGuavaCompatibilityFound; } private GuavaCompatibilityUtil(); }### Answer:
@Test public void isGuavaCompatibilityFound() { assertTrue(GuavaCompatibilityUtil.isGuavaCompatibilityFound()); } |
### Question:
LiveFrameRateMonitor implements IFeedRtcp { @Override public void feed(JFGMsgVideoRtcp rtcp) { Log.d("rtcp", "此消息在smartcall已有打印,无需再打印.rtcp:" + rtcp.frameRate); badFrameCount = rtcp.frameRate == 0 ? ++badFrameCount : 0; if (monitorListener == null) return; boolean isFrameFailed = badFrameCount >= FAILED_TA... |
### Question:
HomeMinePresenterImpl extends AbstractFragmentPresenter<HomeMineContract.View> implements HomeMineContract.Presenter { @Override public void start() { super.start(); addSubscription(getAccountBack()); addSubscription(loginInMe()); } HomeMinePresenterImpl(HomeMineContract.View view); @Override void start()... |
### Question:
HomeMinePresenterImpl extends AbstractFragmentPresenter<HomeMineContract.View> implements HomeMineContract.Presenter { @Override public void stop() { super.stop(); } HomeMinePresenterImpl(HomeMineContract.View view); @Override void start(); @Override void stop(); @Override void portraitBlur(Bitmap bitmap)... |
### Question:
HomeMinePresenterImpl extends AbstractFragmentPresenter<HomeMineContract.View> implements HomeMineContract.Presenter { @Override public void portraitBlur(Bitmap bitmap) { AppLogger.e("需要在io线程操作."); Observable.just(bitmap) .subscribeOn(Schedulers.io()) .map(b -> { if (b == null) { b = BitmapFactory.decodeR... |
### Question:
HomeMinePresenterImpl extends AbstractFragmentPresenter<HomeMineContract.View> implements HomeMineContract.Presenter { @Override public String createRandomName() { String[] firtPart = {"a", "isFriend", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l" , "m", "n", "o", "p", "q", "r", "account", "t", "u", "v... |
### Question:
TimeUtils { public static long getTodayStartTime() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return calendar.getTimeInMillis(); } static String getMM_SS(long time); static String getYHM(long tim... |
### Question:
TimeUtils { public static long getTodayEndTime() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); return calendar.getTimeInMillis(); } static String getMM_SS(long time); static String getYHM(long ti... |
### Question:
TimeUtils { public static long getSpecificDayEndTime(long time) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(time); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); return calendar.getTimeInMillis(); } static String ge... |
### Question:
TimeUtils { public static long getSpecificDayStartTime(long time) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(time); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return calendar.getTimeInMillis(); } static String get... |
### Question:
TimeUtils { public static String getMediaPicTimeInString(final long time) { boolean isSameYear = sameYear(System.currentTimeMillis(), time); if (isSameYear) { return getSimpleDateFormat_2.get().format(new Date(time)); } else { return getSimpleDateFormat_3.get().format(new Date(time)); } } static String g... |
### Question:
TimeUtils { public static String getMediaVideoTimeInString(final long time) { return getSimpleDateFormatVideo.get().format(new Date(time)); } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeInLong); static String getHistoryTime1(long timeInLong); ... |
### Question:
LiveFrameRateMonitor implements IFeedRtcp { @Override public void stop() { preStatus = false; badFrameCount = 0; } @Override void feed(JFGMsgVideoRtcp rtcp); @Override void stop(); void setMonitorListener(MonitorListener monitorListener); }### Answer:
@Test public void stop() throws Exception { } |
### Question:
TimeUtils { public static String getTodayString() { return new SimpleDateFormat("yyyy.MM.dd", Locale.getDefault()) .format(new Date(System.currentTimeMillis())); } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeInLong); static String getHistoryTi... |
### Question:
TimeUtils { public static String getDayString(long time) { return new SimpleDateFormat("yyyy.MM.dd", Locale.getDefault()) .format(new Date(time)); } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeInLong); static String getHistoryTime1(long timeIn... |
### Question:
TimeUtils { public static String getUptime(long time) { if (time == 0) return ContextUtils.getContext().getString(R.string.STANBY_TIME, 0, 0, 0); time = System.currentTimeMillis() / 1000 - time; int temp = (int) time / 60; int minute = temp % 60; temp = temp / 60; int hour = temp % 24; temp = temp / 24; i... |
### Question:
TimeUtils { public static String getDayInMonth(long time) { Calendar instance = Calendar.getInstance(); instance.setTimeInMillis(time); int i = instance.get(Calendar.DAY_OF_MONTH); return i + ""; } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeI... |
### Question:
TimeUtils { public static String getMM_DD(long time) { return new SimpleDateFormat("MM月dd日", Locale.getDefault()) .format(new Date(time)); } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeInLong); static String getHistoryTime1(long timeInLong); s... |
### Question:
TimeUtils { public static String getHH_MM(long time) { return getSimpleDateFormatHHMM.get().format(new Date(time)); } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeInLong); static String getHistoryTime1(long timeInLong); static String getLiveTim... |
### Question:
TimeUtils { public static String getHH_MM_Remain(long timeMs) { int totalMinutes = (int) (timeMs / 1000 / 60); int minutes = totalMinutes % 60; int hours = totalMinutes / 60; String str_hour = hours > 9 ? "" + hours : "0" + hours; String str_minute = minutes > 9 ? "" + minutes : "0" + minutes; return str_... |
### Question:
TimeUtils { public static String getSpecifiedDate(long time) { return simpleDateFormat_1.format(new Date(time)); } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeInLong); static String getHistoryTime1(long timeInLong); static String getLiveTime(l... |
### Question:
TimeUtils { public static long startOfDay(long time) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); return cal.getTimeInMillis(); } static String getMM_SS(long time); static String getYHM(long... |
### Question:
TimeUtils { public static boolean isToday(long time) { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date(time)); Calendar calendar1 = Calendar.getInstance(); calendar1.setTime(new Date(System.currentTimeMillis())); return calendar.get(Calendar.YEAR) == calendar1.get(Calendar.YEAR) && c... |
### Question:
TimeUtils { public static String getSuperString(long time) { return getDateFormatSuper.get().format(new Date(time)); } static String getMM_SS(long time); static String getYHM(long time); static String getHistoryTime(long timeInLong); static String getHistoryTime1(long timeInLong); static String getLiveTi... |
### Question:
TimeUtils { public static String getHomeItemTime(Context context, long time) { if (time == 0) return ""; if (System.currentTimeMillis() - time <= 5 * 60 * 1000L) return context.getString(R.string.JUST_NOW); if (startOfDay(System.currentTimeMillis()) < time) return getSimpleDateFormatHHMM.get().format(new ... |
### Question:
TimeUtils { public static String getMonthInYear(long time) { SimpleDateFormat format = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.FULL, SimpleDateFormat.FULL); format.applyPattern("MMMM"); return format.format(new Date(time)); } static String getMM_SS(long time); static Stri... |
### Question:
TimeUtils { public static String getBellRecordTime(long time) { Date today = new Date(); Date provide = new Date(time); SimpleDateFormat format = (SimpleDateFormat) SimpleDateFormat.getInstance(); if (today.getYear() > provide.getYear()) { format.applyPattern("yyyy.MM.dd"); return format.format(provide); ... |
### Question:
MapSubscription implements Subscription { @Override public boolean isUnsubscribed() { return unsubscribed; } MapSubscription(); @Override boolean isUnsubscribed(); void add(final Subscription s, String tag); void remove(final String tag); void clear(); @Override void unsubscribe(); boolean hasSubscription... |
### Question:
MapSubscription implements Subscription { public void add(final Subscription s, String tag) { remove(tag); if (!unsubscribed) { synchronized (this) { if (!unsubscribed) { if (subscriptions == null) { subscriptions = new HashMap<>(4); } subscriptions.put(tag, s); AppLogger.d("add to sub:" + tag); return; }... |
### Question:
MapSubscription implements Subscription { public void remove(final String tag) { if (!unsubscribed) { Subscription unsubscribe = null; synchronized (this) { if (unsubscribed || subscriptions == null) { return; } unsubscribe = subscriptions.remove(tag); } if (unsubscribe != null) { unsubscribe.unsubscribe(... |
### Question:
MapSubscription implements Subscription { public void clear() { if (!unsubscribed) { Collection<Map.Entry<String, Subscription>> unsubscribe = null; synchronized (this) { if (unsubscribed || subscriptions == null) { return; } else { unsubscribe = subscriptions.entrySet(); subscriptions = null; } unsubscri... |
### Question:
MapSubscription implements Subscription { @Override public void unsubscribe() { if (!unsubscribed) { Collection<Map.Entry<String, Subscription>> unsubscribe = null; synchronized (this) { if (unsubscribed || subscriptions == null) { return; } unsubscribed = true; unsubscribe = subscriptions.entrySet(); sub... |
### Question:
MapSubscription implements Subscription { public boolean hasSubscriptions() { if (!unsubscribed) { synchronized (this) { return !unsubscribed && subscriptions != null && !subscriptions.isEmpty(); } } return false; } MapSubscription(); @Override boolean isUnsubscribed(); void add(final Subscription s, Stri... |
### Question:
DeviceBean implements Parcelable { @Override public int hashCode() { return uuid != null ? uuid.hashCode() : 0; } DeviceBean(); protected DeviceBean(Parcel in); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override int describeContents(); @Override void writ... |
### Question:
RxTask { @CheckReturnValue @NonNull public static <R> Single<R> single(@NonNull final Callable<Task<R>> callable) { return Single.fromCallable(callable).flatMap(new Function<Task<R>, SingleSource<? extends R>>() { @Override public SingleSource<? extends R> apply(Task<R> task) throws Exception { return sin... |
### Question:
RxTask { @CheckReturnValue @NonNull public static <R> Completable completes(@NonNull final Callable<Task<R>> callable) { return Single.fromCallable(callable).flatMapCompletable( new Function<Task<R>, Completable>() { @Override public Completable apply(Task<R> task) throws Exception { return completes(task... |
### Question:
RxTask { @CheckReturnValue @NonNull public static <R> Maybe<R> maybe(@NonNull final Callable<Task<R>> callable) { return Single.fromCallable(callable).flatMapMaybe( new Function<Task<R>, MaybeSource<? extends R>>() { @Override public MaybeSource<? extends R> apply(Task<R> task) throws Exception { return m... |
### Question:
SimpleMemoryManager { public int malloc(final int size) { return malloc_internal(size + 16) + 16; } SimpleMemoryManager(final int totalMemory); int freeMemory(); int allocated(); int malloc(final int size); void free(final int position); void GC(); void printDebug(final PrintStream ps); }### Answer:
@Tes... |
### Question:
Module { public MemorySection getMems() { return mems; } Module(final String label, final String sourcemapFileName); void writeTo(final TextWriter writer, final boolean enableDebug); TypesSection getTypes(); GlobalsIndex globalsIndex(); EventIndex eventIndex(); FunctionIndex functionIndex(); void writeTo(... |
### Question:
Module { public ImportsSection getImports() { return imports; } Module(final String label, final String sourcemapFileName); void writeTo(final TextWriter writer, final boolean enableDebug); TypesSection getTypes(); GlobalsIndex globalsIndex(); EventIndex eventIndex(); FunctionIndex functionIndex(); void w... |
### Question:
SimpleMemoryManager { public void GC() { Chunk current = allocatedList; while (current != null) { final Chunk next = current.next; free_internal(current.position); current = next; } } SimpleMemoryManager(final int totalMemory); int freeMemory(); int allocated(); int malloc(final int size); void free(final... |
### Question:
VLQ { public static int[] decode(final String aData) { final List<Integer> theResult = new ArrayList<>(); int theShift = 0; int theValue = 0; for (int i=0;i<aData.length();i++) { int theInteger = CHARACTERS.indexOf(aData.charAt(i)); final int hasContinuationBit = theInteger & 32; theInteger &= 31; theValu... |
### Question:
Partitioning { public List<Set<T>> partitions() { return partitions; } Partitioning(final Set<T> nodes, final Predicate<Edge<EdgeType, T>> edgeFilter); List<Set<T>> partitions(); }### Answer:
@Test public void testEmptyGraph() { final Partitioning thePartitioning = new Partitioning(new HashSet(), t -> tr... |
### Question:
VLQ { public static String encode(final int[] aData) { final StringBuilder theResult = new StringBuilder(); for (int i = 0; i < aData.length; i += 1 ) { theResult.append(encodeInteger(aData[i])); } return theResult.toString(); } private VLQ(); static int[] decode(final String aData); static String encode... |
### Question:
BytecodeLoader { public BytecodeClass loadByteCode(final BytecodeObjectTypeRef aTypeRef) throws IOException, ClassNotFoundException { return loadByteCode(aTypeRef, bytecodeReplacer); } BytecodeLoader(final ClassLoader aClassLoader); BytecodeSignatureParser getSignatureParser(); BytecodeClass loadByteCode(... |
### Question:
Function extends Container implements Importable, Callable { @Override public void writeTo(final TextWriter textWriter, final Module aModule) throws IOException { textWriter.opening(); textWriter.write("func"); textWriter.space(); textWriter.writeLabel(label); textWriter.space(); functionType.writeRefTo(t... |
### Question:
StructuredControlFlow { public void printDebug(final PrintWriter pw) { pw.println("Original:"); printDebug(pw, false); for (final JumpArrow<T> arrow : knownJumpArrows) { pw.println(String.format(" %s %d -> %d", arrow.getEdgeType(), indexOf(arrow.getTail()), indexOf(arrow.getHead()))); } pw.println(); pw.p... |
### Question:
AnnotationBasedExpiration implements BeanFactoryAware, CustomExpiry<K, V> { protected ExpirationAttributes getDefaultExpirationAttributes() { return this.defaultExpirationAttributes; } AnnotationBasedExpiration(); AnnotationBasedExpiration(ExpirationAttributes defaultExpirationAttributes); static Annotat... |
### Question:
AnnotationBasedExpiration implements BeanFactoryAware, CustomExpiry<K, V> { protected Expiration getExpiration(Region.Entry<K, V> entry) { return getExpiration(entry.getValue()); } AnnotationBasedExpiration(); AnnotationBasedExpiration(ExpirationAttributes defaultExpirationAttributes); static AnnotationB... |
### Question:
AnnotationBasedExpiration implements BeanFactoryAware, CustomExpiry<K, V> { protected IdleTimeoutExpiration getIdleTimeout(Region.Entry<K, V> entry) { return getIdleTimeout(entry.getValue()); } AnnotationBasedExpiration(); AnnotationBasedExpiration(ExpirationAttributes defaultExpirationAttributes); stati... |
### Question:
RegionShortcutConverter implements Converter<String, RegionShortcut> { protected static String toUpperCase(final String value) { return (value != null ? value.toUpperCase().trim() : String.valueOf(value)); } @Override RegionShortcut convert(final String source); }### Answer:
@Test public void testToUppe... |
### Question:
RegionShortcutConverter implements Converter<String, RegionShortcut> { @Override public RegionShortcut convert(final String source) { return RegionShortcut.valueOf(toUpperCase(source)); } @Override RegionShortcut convert(final String source); }### Answer:
@Test public void testConvert() { for (RegionSho... |
### Question:
ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent> { @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public Class<? extends GemFireCache> getObjectType() { return Optional.ofNullable(getCache()).map(Object::getClass).orElse((Class) ClientCache.cl... |
### Question:
ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent> { @Override protected Object createFactory(Properties gemfireProperties) { return new ClientCacheFactory(gemfireProperties); } @Override void onApplicationEvent(ContextRefreshedEvent event); @Override @S... |
### Question:
ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent> { @Override @SuppressWarnings("unchecked") protected <T extends GemFireCache> T createCache(Object factory) { return (T) ((ClientCacheFactory) factory).create(); } @Override void onApplicationEvent(Conte... |
### Question:
ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent> { @Override public final Boolean getEnableAutoReconnect() { return Boolean.FALSE; } @Override void onApplicationEvent(ContextRefreshedEvent event); @Override @SuppressWarnings({ "rawtypes", "unchecked" }... |
### Question:
ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent> { @Override public final void setEnableAutoReconnect(Boolean enableAutoReconnect) { throw new UnsupportedOperationException("Auto-reconnect does not apply to clients"); } @Override void onApplicationEven... |
### Question:
ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent> { @Override public final Boolean getUseClusterConfiguration() { return Boolean.FALSE; } @Override void onApplicationEvent(ContextRefreshedEvent event); @Override @SuppressWarnings({ "rawtypes", "unchecke... |
### Question:
ClientCacheFactoryBean extends CacheFactoryBean implements ApplicationListener<ContextRefreshedEvent> { @Override public final void setUseClusterConfiguration(Boolean useClusterConfiguration) { throw new UnsupportedOperationException("Cluster-based Configuration is not applicable for clients"); } @Overri... |
### Question:
ClientRegionFactoryBean extends ConfigurableRegionFactoryBean<K, V> implements SmartLifecycleSupport, EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K, V>, DisposableBean { protected ClientRegionFactory<K, V> createClientRegionFactory(ClientCache clientCache, ClientRegionShortcut clientRegionShortcu... |
### Question:
ClientRegionFactoryBean extends ConfigurableRegionFactoryBean<K, V> implements SmartLifecycleSupport, EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K, V>, DisposableBean { ClientRegionShortcut resolveClientRegionShortcut() { ClientRegionShortcut resolvedShortcut = this.shortcut; if (resolvedShortcu... |
### Question:
ClientRegionFactoryBean extends ConfigurableRegionFactoryBean<K, V> implements SmartLifecycleSupport, EvictingRegionFactoryBean, ExpiringRegionFactoryBean<K, V>, DisposableBean { @Override public void destroy() throws Exception { Optional.ofNullable(getObject()).ifPresent(region -> { if (isClose() && Regi... |
### Question:
ListRegionsOnServerFunction implements Function { @Override @SuppressWarnings("unchecked") public void execute(FunctionContext functionContext) { List<String> regionNames = new ArrayList<>(); for (Region<?, ?> region : getCache().rootRegions()) { regionNames.add(region.getName()); } functionContext.getRes... |
### Question:
AnnotationBasedExpiration implements BeanFactoryAware, CustomExpiry<K, V> { protected TimeToLiveExpiration getTimeToLive(Region.Entry<K, V> entry) { return getTimeToLive(entry.getValue()); } AnnotationBasedExpiration(); AnnotationBasedExpiration(ExpirationAttributes defaultExpirationAttributes); static A... |
### Question:
ListRegionsOnServerFunction implements Function { @Override public String getId() { return this.getClass().getName(); } @Override @SuppressWarnings("unchecked") void execute(FunctionContext functionContext); @Override String getId(); @Override boolean hasResult(); @Override boolean isHA(); @Override bool... |
### Question:
ListRegionsOnServerFunction implements Function { @Override public boolean hasResult() { return true; } @Override @SuppressWarnings("unchecked") void execute(FunctionContext functionContext); @Override String getId(); @Override boolean hasResult(); @Override boolean isHA(); @Override boolean optimizeForW... |
### Question:
ClientRegionShortcutConverter implements Converter<String, ClientRegionShortcut> { protected static String toUpperCase(final String value) { return (value != null ? value.toUpperCase().trim() : String.valueOf(value)); } @Override ClientRegionShortcut convert(final String source); }### Answer:
@Test publ... |
### Question:
ClientRegionShortcutConverter implements Converter<String, ClientRegionShortcut> { @Override public ClientRegionShortcut convert(final String source) { return ClientRegionShortcut.valueOf(toUpperCase(source)); } @Override ClientRegionShortcut convert(final String source); }### Answer:
@Test public void ... |
### Question:
GemfireDataSourcePostProcessor implements BeanFactoryAware, BeanPostProcessor { @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { if (beanFactory instanceof ConfigurableBeanFactory) { this.beanFactory = (ConfigurableBeanFactory) beanFactory; } else { throw new TypeMisma... |
### Question:
GemfireDataSourcePostProcessor implements BeanFactoryAware, BeanPostProcessor { boolean containsRegionInformation(Object results) { return results instanceof Object[] && ((Object[]) results).length > 0 && ((Object[]) results)[0] instanceof RegionInformation; } @Override void setBeanFactory(BeanFactory be... |
### Question:
GemfireDataSourcePostProcessor implements BeanFactoryAware, BeanPostProcessor { void createClientProxyRegions(ConfigurableBeanFactory beanFactory, ClientCache clientCache, Iterable<String> regionNames) { if (regionNames.iterator().hasNext()) { ClientRegionShortcut resolvedClientRegionShortcut = resolveCli... |
### Question:
FactoryDefaultsPoolAdapter extends PoolAdapter { @Override public List<InetSocketAddress> getLocators() { return Collections.emptyList(); } @Override int getFreeConnectionTimeout(); @Override long getIdleTimeout(); @Override int getLoadConditioningInterval(); @Override List<InetSocketAddress> getLocators... |
### Question:
FactoryDefaultsPoolAdapter extends PoolAdapter { @Override public String getName() { return DEFAULT_POOL_NAME; } @Override int getFreeConnectionTimeout(); @Override long getIdleTimeout(); @Override int getLoadConditioningInterval(); @Override List<InetSocketAddress> getLocators(); @Override int getMaxCon... |
### Question:
FactoryDefaultsPoolAdapter extends PoolAdapter { @Override public List<InetSocketAddress> getOnlineLocators() { return Collections.emptyList(); } @Override int getFreeConnectionTimeout(); @Override long getIdleTimeout(); @Override int getLoadConditioningInterval(); @Override List<InetSocketAddress> getLo... |
### Question:
FactoryDefaultsPoolAdapter extends PoolAdapter { @Override public QueryService getQueryService() { return null; } @Override int getFreeConnectionTimeout(); @Override long getIdleTimeout(); @Override int getLoadConditioningInterval(); @Override List<InetSocketAddress> getLocators(); @Override int getMaxCo... |
### Question:
FactoryDefaultsPoolAdapter extends PoolAdapter { @Override public List<InetSocketAddress> getServers() { return Collections.singletonList(new InetSocketAddress(LOCALHOST, GemfireUtils.DEFAULT_CACHE_SERVER_PORT)); } @Override int getFreeConnectionTimeout(); @Override long getIdleTimeout(); @Override int g... |
### Question:
AnnotationBasedExpiration implements BeanFactoryAware, CustomExpiry<K, V> { private <T extends Annotation> T getAnnotation(Object obj, Class<T> annotationType) { return AnnotationUtils.getAnnotation(obj.getClass(), annotationType); } AnnotationBasedExpiration(); AnnotationBasedExpiration(ExpirationAttrib... |
### Question:
FactoryDefaultsPoolAdapter extends PoolAdapter { public void destroy() { destroy(DEFAULT_KEEP_ALIVE); } @Override int getFreeConnectionTimeout(); @Override long getIdleTimeout(); @Override int getLoadConditioningInterval(); @Override List<InetSocketAddress> getLocators(); @Override int getMaxConnections(... |
### Question:
DefaultableDelegatingPoolAdapter { protected Pool getDelegate() { return this.delegate; } protected DefaultableDelegatingPoolAdapter(Pool delegate); static DefaultableDelegatingPoolAdapter from(Pool delegate); DefaultableDelegatingPoolAdapter preferDefault(); DefaultableDelegatingPoolAdapter preferPool()... |
### Question:
DefaultableDelegatingPoolAdapter { public static DefaultableDelegatingPoolAdapter from(Pool delegate) { return new DefaultableDelegatingPoolAdapter(delegate) {}; } protected DefaultableDelegatingPoolAdapter(Pool delegate); static DefaultableDelegatingPoolAdapter from(Pool delegate); DefaultableDelegating... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.