method2testcases stringlengths 118 6.63k |
|---|
### Question:
Elements implements Constraint { public Elements( @NotNull Constraint unions, @Nullable Constraint exclusion ) { this.unions = unions; this.exclusion = exclusion; } Elements( @NotNull Constraint unions, @Nullable Constraint exclusion ); @Override void check( Scope scope, Ref<Value> valueRef ); @NotNull @O... |
### Question:
ElementSetSpec implements Constraint { public ElementSetSpec( List<Constraint> unions ) { this.unions = new ArrayList<>( unions ); } ElementSetSpec( List<Constraint> unions ); @Override void check( Scope scope, Ref<Value> valueRef ); @NotNull @Override Value getMinimumValue( @NotNull Scope scope ); @NotNu... |
### Question:
TimeUtils { public static Instant parseUTCTime( String value ) { if( !UTCParser.isValid( value ) ) throw new IllegalArgumentException( "Not an UTCTime string: " + value ); return new UTCParser( value ).asInstant(); } private TimeUtils(); @NotNull static String formatInstant( TemporalAccessor instant, Str... |
### Question:
NullBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) { assert context.getType().getFamily() == Family.NULL; assert context.getLength() == 0; return NullValue.INSTANCE; } @Override Value decode( @NotNull ReaderContext context ); }### Answer:
@Test( expect... |
### Question:
TimeUtils { @NotNull public static String formatInstant( TemporalAccessor instant, String format, boolean optimize ) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern( format ) .withZone( ZoneId.of( "GMT" ) ); String result = formatter.format( instant ); if( result.indexOf( '.' ) > 0 ) { if( res... |
### Question:
NRxUtils { public static String toCanonicalNR3( String value ) { if( "-Infinity".equals( value ) || "Infinity".equals( value ) || "NaN".equals( value ) ) return value; if( !FORMAT_PATTERN.matcher( value ).matches() ) throw new IllegalArgumentException(); value = value.toUpperCase(); String mantisStr; Stri... |
### Question:
RefUtils { public static void assertTypeRef( String name ) { if( !isTypeRef( name ) ) throw new IllegalArgumentException( "Not a type reference: " + name ); } private RefUtils(); static void assertTypeRef( String name ); static boolean isSameAsDefaultValue( Scope scope, ComponentType component, Value res... |
### Question:
DefaultBerReader extends AbstractBerReader { @SuppressWarnings( "NumericCastThatLosesPrecision" ) @Override public byte read() throws IOException { int read = is.read(); if( read != -1 ) position++; return (byte)read; } DefaultBerReader( InputStream is, ValueFactory valueFactory ); @Override int position(... |
### Question:
RefUtils { public static void assertValueRef( String name ) { if( !isValueRef( name ) ) throw new IllegalArgumentException( "Not a value reference: " + name ); } private RefUtils(); static void assertTypeRef( String name ); static boolean isSameAsDefaultValue( Scope scope, ComponentType component, Value ... |
### Question:
RefUtils { public static boolean isSameAsDefaultValue( Scope scope, ComponentType component, Value resolve ) throws ResolutionException { if( component.getDefaultValue() == null ) return false; resolve = toBasicValue( scope, resolve ); Value value = toBasicValue( scope, component.getDefaultValue() ); retu... |
### Question:
HexUtils { @SuppressWarnings( "MagicNumber" ) public static String toHexString( byte[] array ) { if( ArrayUtils.isEmpty( array ) ) return ""; StringBuilder sb = new StringBuilder(); for( byte value : array ) { if( ( value & 0xF0 ) == 0 ) sb.append( '0' ); sb.append( Integer.toHexString( value & 0xFF ).toU... |
### Question:
CollectionUtils { @NotNull public static String convertToBString( Iterable<? extends Ref<Value>> valueList, int desiredSize ) { Collection<Long> values = new HashSet<>(); Long maxValue = 0L; for( Ref<Value> valueRef : valueList ) { NamedValue value = (NamedValue)valueRef; if( value.getReferenceKind() != K... |
### Question:
TemplateParameter implements Comparable<TemplateParameter> { public String getName() { if( reference instanceof TypeNameRef ) return ( (TypeNameRef)reference ).getName(); if( reference instanceof ValueNameRef ) return ( (ValueNameRef)reference ).getName(); throw new IllegalStateException(); } TemplatePara... |
### Question:
Template { public Template() { this( false ); } Template(); Template( boolean instance ); void addParameter( TemplateParameter parameter ); @Nullable TemplateParameter getParameter( @NotNull String name ); @NotNull TemplateParameter getParameter( int index ); int getParameterCount(); boolean isInstance()... |
### Question:
Template { @Nullable public TemplateParameter getParameter( @NotNull String name ) { return parameterMap.get( name ); } Template(); Template( boolean instance ); void addParameter( TemplateParameter parameter ); @Nullable TemplateParameter getParameter( @NotNull String name ); @NotNull TemplateParameter ... |
### Question:
EnumTypeMapperFactory implements TypeMapperFactory { @SuppressWarnings( "unchecked" ) @Override public TypeMapper mapType( Type type, TypeMetadata metadata ) { if( !isSupportedFor( type ) ) throw new IllegalArgumentException( "Only enum types allowed" ); return mapEnum( (Class<Enum<?>>)type ); } EnumTypeM... |
### Question:
Introspector { @NotNull public JavaType introspect( Type type ) { if( typeMap.containsKey( type.getTypeName() ) ) return typeMap.get( type.getTypeName() ); if( type instanceof Class<?> ) return forClass( (Class<?>)type ); if( type instanceof ParameterizedType ) return forParameterized( (ParameterizedType)... |
### Question:
RealTypeMapper implements TypeMapper { @NotNull @Override public Value toAsn1( @NotNull ValueFactory factory, @NotNull Object value ) { if( isFloat() && isAssignableToFloat( value ) ) return factory.real( (Float)value ); if( isDouble() && isAssignableToDouble( value ) ) return factory.real( (Double)value ... |
### Question:
RealTypeMapper implements TypeMapper { @NotNull @Override public Object toJava( @NotNull Value value ) { if( value.getKind() != Kind.REAL ) throw new IllegalArgumentException( "Unable to handle value of kind: " + value.getKind() ); RealValue rv = value.toRealValue(); if( isFloat() ) return rv.asFloat(); i... |
### Question:
StringTypeMapper implements TypeMapper { @NotNull @Override public Value toAsn1( @NotNull ValueFactory factory, @NotNull Object value ) { if( !javaType.isAssignableFrom( value.getClass() ) ) throw new IllegalArgumentException( "Unable to convert value: " + value ); return factory.cString( (String)value );... |
### Question:
StringTypeMapper implements TypeMapper { @NotNull @Override public Object toJava( @NotNull Value value ) { if( value.getKind() != Kind.C_STRING ) throw new IllegalArgumentException( "Unable to convert value of kind: " + value.getKind() ); return value.toStringValue().asString(); } StringTypeMapper( Class<... |
### Question:
IntegerTypeMapper implements TypeMapper { @NotNull @Override public Value toAsn1( @NotNull ValueFactory factory, @NotNull Object value ) { if( isByte() && isAssignableToByte( value ) ) return factory.integer( (Byte)value ); if( isShort() && isAssignableToShort( value ) ) return factory.integer( (Short)val... |
### Question:
IntegerTypeMapper implements TypeMapper { @NotNull @Override public Object toJava( @NotNull Value value ) { if( value.getKind() != Kind.INTEGER ) throw new IllegalArgumentException( "Unable to convert to integer value of kind: " + value.getKind() ); IntegerValue iv = value.toIntegerValue(); if( isByte() )... |
### Question:
ByteArrayTypeMapper implements TypeMapper { @NotNull @Override public Value toAsn1( @NotNull ValueFactory factory, @NotNull Object value ) { if( !byte[].class.isAssignableFrom( value.getClass() ) ) throw new IllegalArgumentException( "Unable to convert value: " + value ); byte[] array = (byte[])value; ret... |
### Question:
BitStringBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.BIT_STRING; assert !context.getTag().isConstructed(); if( context.getLength() == 0 ) return context.getValueFactory... |
### Question:
ByteArrayTypeMapper implements TypeMapper { @NotNull @Override public Object toJava( @NotNull Value value ) { if( value.getKind() != Kind.BYTE_ARRAY ) throw new IllegalArgumentException( "Unable to handle value of kind: " + value.getKind() ); return value.toByteArrayValue().asByteArray(); } ByteArrayTypeM... |
### Question:
DateTypeMapper implements TypeMapper { @NotNull @Override public Value toAsn1( @NotNull ValueFactory factory, @NotNull Object value ) { if( !javaType.isAssignableFrom( value.getClass() ) ) throw new IllegalArgumentException( "Unable to convert value: " + value ); if( isDate() ) return factory.timeValue( (... |
### Question:
DateTypeMapper implements TypeMapper { @NotNull @Override public Object toJava( @NotNull Value value ) { if( value.getKind() != Kind.TIME ) throw new IllegalArgumentException( "Unable to convert values of kind: " + value.getKind() ); Instant instant = value.toDateValue().asInstant(); if( isInstant() ) ret... |
### Question:
BooleanTypeMapper implements TypeMapper { @NotNull @Override public Value toAsn1( @NotNull ValueFactory factory, @NotNull Object value ) { if( !isBooleanClass( value ) ) throw new IllegalArgumentException( "Unable to convert value: " + value ); if( Boolean.TRUE.equals( value ) ) return BooleanValue.TRUE; ... |
### Question:
BooleanTypeMapper implements TypeMapper { @NotNull @Override public Object toJava( @NotNull Value value ) { if( value.getKind() != Kind.BOOLEAN ) throw new IllegalArgumentException( "Unable to handle value of kind: " + value.getKind() ); if( Objects.equals( value, BooleanValue.TRUE ) ) return Boolean.TRUE... |
### Question:
GeneralizedTimeBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.GENERALIZED_TIME; assert context.getValue().getKind() == Kind.TIME; Instant instant = context.getValue().toDat... |
### Question:
StringBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.RESTRICTED_STRING; assert context.getValue().getKind() == Kind.C_STRING; Type type = context.getType(); while( !( type ... |
### Question:
ObjectIDBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.OID; assert context.getLength() > 0; List<Ref<Value>> list = new ArrayList<>(); int length = context.getLength(); wh... |
### Question:
BooleanBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException { assert context.getType().getFamily() == Family.BOOLEAN; assert context.getLength() == 1; byte content = context.read(); return content == BerUtils.BOOLEAN_FALSE ? BooleanValue.FAL... |
### Question:
BooleanBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.BOOLEAN; assert context.getValue().getKind() == Kind.BOOLEAN; context.writeHeader( TAG, 1 ); boolean value = context.getValue().toBoo... |
### Question:
OctetStringBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.OCTET_STRING; assert context.getValue().getKind() == Kind.BYTE_ARRAY; byte[] bytes = context.getValue().toByteArrayValue().asByte... |
### Question:
OctetStringBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.OCTET_STRING; assert !context.getTag().isConstructed(); if( context.getLength() == -1 ) return readByteArrayValue... |
### Question:
RealBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException { assert context.getType().getFamily() == Family.REAL; assert !context.getTag().isConstructed(); if( context.getLength() == 0 ) return context.getValueFactory().rZero(); byte first = c... |
### Question:
IntegerBerEncoder implements BerEncoder { static void writeLong( @NotNull AbstractBerWriter os, long value, @Nullable Tag tag, boolean writeHeader ) throws IOException { if( tag == null && writeHeader ) throw new IOException( "Unable to write header: tag is unavailable." ); int size = calculateByteCount( ... |
### Question:
IntegerBerEncoder implements BerEncoder { static byte[] toByteArray( long value ) { int size = calculateByteCount( value ); byte[] result = new byte[size]; for( int i = size - 1, position = 0; i >= 0; i--, position++ ) result[position] = getByteByIndex( value, i ); return result; } @Override void encode(... |
### Question:
IntegerBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException { assert context.getType().getFamily() == Family.INTEGER; assert context.getLength() >= 0; return readInteger( context.getReader(), context.getLength() ); } @Override Value decode(... |
### Question:
IntegerBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.INTEGER; assert context.getValue().getKind() == Kind.INTEGER; writeLong( context.getWriter(), context.getValue().toIntegerValue().asL... |
### Question:
ObjectIDBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.OID; assert context.getValue().getKind() == Kind.OID; if( !context.isWriteHeader() ) writeObjectIDImpl( context.getWr... |
### Question:
StringBerDecoder implements BerDecoder { @Override public Value decode( @NotNull ReaderContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.RESTRICTED_STRING; Type type = context.getType(); while( !( type instanceof StringType ) ) { assert type != null; type... |
### Question:
NullBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.NULL; assert context.getValue().getKind() == Kind.NULL; context.writeHeader( TAG, 0 ); } @Override void encode( @NotNull WriterContext ... |
### Question:
UTCTimeBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException, Asn1Exception { assert context.getType().getFamily() == Family.UTC_TIME; assert context.getValue().getKind() == Kind.TIME; String content = TimeUtils.formatInstant( context.getValue... |
### Question:
EnumeratedBerEncoder implements BerEncoder { @Override public void encode( @NotNull WriterContext context ) throws IOException { assert context.getType().getFamily() == Family.ENUMERATED; assert context.getValue().getKind() == Kind.NAME && context.getValue().toNamedValue().getReferenceKind() == Kind.INTEG... |
### Question:
GroupSyntaxObject implements SyntaxObject { @Override public String getText() { throw new UnsupportedOperationException(); } @Override Kind getKind(); @Override String getText(); void addObject( SyntaxObject object ); List<SyntaxObject> getObjects(); }### Answer:
@Test( expected = UnsupportedOperationEx... |
### Question:
GroupSyntaxObject implements SyntaxObject { public void addObject( SyntaxObject object ) { objects.add( object ); } @Override Kind getKind(); @Override String getText(); void addObject( SyntaxObject object ); List<SyntaxObject> getObjects(); }### Answer:
@Test public void testAddObject() { GroupSyntaxOb... |
### Question:
FileQueueService { public QueueFile getQueueFile() { return this.queueFile; } @Autowired FileQueueService(@Value("${modum.tokenapp.email.queue-file-path}") String queueFilePath,
@Autowired ObjectMapper objectMapper); FileQueueService(String queueFilePath); FileQueueService()... |
### Question:
SendEmailTask { public SendEmailTask() { } SendEmailTask(); @Scheduled(initialDelay = 10000, fixedRateString = "${modum.tokenapp.email.send-email-interval}") void sendEmail(); }### Answer:
@Test public void testSendEmailTask() throws IOException, URISyntaxException { FileQueueService fileQueueService = n... |
### Question:
Etherscan { public BigInteger getBalance(String address) throws IOException { String s = "https: "?module=account" + "&action=balance" + "&address=" + address + "&tag=latest" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<Str... |
### Question:
Etherscan { public BigInteger get20Balances(String... contract) throws IOException { return get20Balances(Arrays.asList(contract)); } BigInteger getBalance(String address); List<Triple<Date,Long,Long>> getTxEth(String address); BigInteger get20Balances(String... contract); BigInteger get20Balances(List<S... |
### Question:
Etherscan { public long getCurrentBlockNr() throws IOException { String s = "https: "?module=proxy" + "&action=eth_blockNumber" + "&apikey="+apiKey; HttpHeaders headers = new HttpHeaders(); headers.set("User-Agent", options.getUserAgent()); ResponseEntity<String> res = restTemplate.exchange(s, HttpMethod.... |
### Question:
BerIdentifier { public int encode(BerByteArrayOutputStream berOStream) throws IOException { for (int i = (identifier.length - 1); i >= 0; i--) { berOStream.write(identifier[i]); } return identifier.length; } BerIdentifier(int identifierClass, int primitive, int tagNumber); BerIdentifier(); int encode(Ber... |
### Question:
BerInteger { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val < 1 || length.val > 8) { throw new IOException... |
### Question:
BerOctetString { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return cod... |
### Question:
BerOctetString { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); octetString = new byte[length.val]; if (length.val != 0) ... |
### Question:
BerObjectIdentifier { public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { int firstSubidentifier = 40 * objectIdentifie... |
### Question:
BerLength { public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { if (length <= 127) { berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i ... |
### Question:
BerObjectIdentifier { public int decode(InputStream iStream, boolean explicit) throws IOException { int codeLength = 0; if (explicit) { codeLength += id.decodeAndCheck(iStream); } BerLength length = new BerLength(); codeLength += length.decode(iStream); if (length.val == 0) { objectIdentifierComponents = ... |
### Question:
BerLength { public int decode(InputStream iStream) throws IOException { val = iStream.read(); int length = 1; if ((val & 0x80) != 0) { int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLength > 4) { throw new IOException("Length is out of bound!"); } val = 0; byte[] b... |
### Question:
Functions { public static <T> List<T> myFilter(List<T> list, MyPredicate<T> myPredicate) { ArrayList<T> result = new ArrayList<>(); for (T t : list) { if (myPredicate.test(t)) result.add(t); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T>... |
### Question:
Functions { public static <T> List<T> myGenerate(MySupplier<T> supplier, int count) { List<T> result = new ArrayList<>(); for (int i = 0; i < count; i++) { result.add(supplier.get()); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, ... |
### Question:
Functions { public static <T, R> List<R> myMap(List<T> list, MyFunction<T, R> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { result.add(myFunction.apply(t)); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list,... |
### Question:
Functions { public static <T, R> List<R> myFlatMap(List<T> list, MyFunction<T, List<R>> myFunction) { ArrayList<R> result = new ArrayList<>(); for (T t : list) { List<R> application = myFunction.apply(t); result.addAll(application); } return result; } static List<T> myFilter(List<T> list, MyPredicate<T> ... |
### Question:
Functions { public static <T> void myForEach(List<T> list, MyConsumer<T> myConsumer) { for (T t : list) { myConsumer.accept(t); } } static List<T> myFilter(List<T> list, MyPredicate<T> myPredicate); static List<R> myMap(List<T> list, MyFunction<T, R> myFunction); static List<R> myFlatMap(List<T> list, My... |
### Question:
WeChatUtils { public static String joinPath(final String firstPath, final String secondPath) { Validate.notEmpty(firstPath); Validate.notEmpty(secondPath); final String tmp1 = firstPath.endsWith("/") ? firstPath.substring(0, firstPath.length() - 1) : firstPath; final String tmp2 = secondPath.startsWith("/... |
### Question:
WeChatPayRestTemplateClient implements WeChatPayClient { @Override public UnifiedOrderResponse unifiedOrder( final UnifiedOrderRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.UNIFIED_ORDER_PATH, request, UnifiedOrderResponse.class) .getBo... |
### Question:
WeChatPayRestTemplateClient implements WeChatPayClient { @Override public OrderQueryResponse orderQuery( final OrderQueryRequest request) throws WeChatPayException { Objects.requireNonNull(request); return postForEntity( WeChatPayClient.ORDER_QUERY_PATH, request, OrderQueryResponse.class) .getBody(); } We... |
### Question:
WeChatMpController { @GetMapping(path = "${wechat.mp.authorize-code-path:" + WeChatMpProperties.AUTHORIZE_CODE_PATH + '}') public void authorizeCode( @RequestParam("code") final String code) { final WeChatMpAccessTokenResponse accessTokenResponse = this.weChatMpClient.accessToken(code); if (accessTokenRes... |
### Question:
WeChatMpAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatMpController weChatMpController(final WeChatMpClient weChatMpClient, final ApplicationEventPublisher publisher) { return new WeChatMpController(this.weChatMpProperties, weChatMpClient, publisher); } WeChatMpAutoConfiguration(final We... |
### Question:
WeChatPayUtils { @NotNull public static String generateSign( @NotNull final BasePayRequest request, @NotNull final String mchKey) { return generateSign(signParamsFrom(request), mchKey); } @NotNull static String generateSign(
@NotNull final BasePayRequest request, @NotNull final String mchKey)... |
### Question:
WeChatPayUtils { public static <T> Map<String, T> beansMapFrom( @NotNull final SortedMap<String, String> params, @NotNull final Map<String, BiConsumer<String, T>> mapping, @NotNull final Supplier<T> newT) { final Map<String, T> rtMap = new HashMap<>(); for (final Map.Entry<String, String> entry : params.e... |
### Question:
NotifyResult extends BasePayResponse { @Override public void beforeSign() { if (null == this.coupons && null != this.otherParams) { this.coupons = WeChatPayUtils.couponsFrom(this.otherParams); } } @Override void beforeSign(); }### Answer:
@Test public void testParse() { final String xml = WeChatTestUtil... |
### Question:
RefundQueryResponse extends BasePayResponse { @Override public void beforeSign() { if (null == this.refunds && null != this.otherParams) { final Map<String, Refund> refundsMap = WeChatPayUtils.beansMapFrom(this.otherParams, createRefundMapping(), Refund::new); initCoupons(refundsMap); this.refunds = new A... |
### Question:
WeChatMpResponse { @JsonAnySetter protected void setOtherProperties(final String name, final String value) { this.otherProperties.put(name, value); } boolean isSuccessful(); }### Answer:
@Test public void setOtherProperties() throws Exception { final ObjectMapper mapper = new ObjectMapper(); final Demo ... |
### Question:
WeChatMpUtils { public static String generateAuthorizeUrl( @NotNull final String appId, @NotNull final String redirectUri, @NotNull final AuthorizeScope scope, @NotNull final String state) { return "https: + "&redirect_uri=" + WeChatUtils.urlEncode(redirectUri) + "&response_type=code&scope=" + scope.getSc... |
### Question:
WeChatPayAutoConfiguration { @Bean @ConditionalOnMissingBean public WeChatPayClient weChatPayClient( @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @Autowired(required = false) RestTemplate restTemplate) { if (null == restTemplate) { restTemplate = new RestTemplate(); } return new WeCh... |
### Question:
BerLength implements Serializable { public static int encodeLength(OutputStream reverseOS, int length) throws IOException { if (length <= 127) { reverseOS.write(length); return 1; } if (length <= 255) { reverseOS.write(length); reverseOS.write(0x81); return 2; } if (length <= 65535) { reverseOS.write(leng... |
### Question:
BerOctetString implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @... |
### Question:
BerOctetString implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int de... |
### Question:
BerOctetString implements Serializable, BerType { @Override public String toString() { return HexString.fromBytes(value); } BerOctetString(); BerOctetString(byte[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStream reverseOS, boolean withTag); @Override int decode(InputStream i... |
### Question:
BerObjectIdentifier implements Serializable, BerType { @Override public int encode(OutputStream reverseOS) throws IOException { return encode(reverseOS, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); @Override int encode(OutputStream reverseOS); int e... |
### Question:
BerObjectIdentifier implements Serializable, BerType { @Override public int decode(InputStream is) throws IOException { return decode(is, true); } BerObjectIdentifier(); BerObjectIdentifier(byte[] code); BerObjectIdentifier(int[] value); @Override int encode(OutputStream reverseOS); int encode(OutputStr... |
### Question:
BerGeneralizedTime extends BerVisibleString { @Override public int encode(OutputStream reverseOS, boolean withTag) throws IOException { int codeLength = super.encode(reverseOS, false); if (withTag) { codeLength += tag.encode(reverseOS); } return codeLength; } BerGeneralizedTime(); BerGeneralizedTime(byte... |
### Question:
BerBitString implements Serializable, BerType { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (boolean bit : getValueAsBooleans()) { if (bit) { sb.append('1'); } else { sb.append('0'); } } return sb.toString(); } BerBitString(); BerBitString(byte[] value, int numBits); ... |
### Question:
BerLength implements Serializable { public int decode(InputStream is) throws IOException { val = is.read(); if (val < 128) { if (val == -1) { throw new EOFException("Unexpected end of input stream."); } return 1; } int lengthLength = val & 0x7f; if (lengthLength == 0) { val = -1; return 1; } if (lengthLen... |
### Question:
PrimaryMetaStore extends AbstractMetaStore { @Override public FederationType getFederationType() { return FederationType.PRIMARY; } PrimaryMetaStore(); PrimaryMetaStore(
String name,
String remoteMetaStoreUris,
AccessControlType accessControlType,
String... writableDatabaseWhiteli... |
### Question:
MetaStoreMappingDecorator implements MetaStoreMapping { @Override public String getMetastoreMappingName() { return metaStoreMapping.getMetastoreMappingName(); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); @Override String transformOutboundDatabaseName(String databaseName); @Override List... |
### Question:
MetaStoreMappingDecorator implements MetaStoreMapping { @Override public boolean isAvailable() { return metaStoreMapping.isAvailable(); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); @Override String transformOutboundDatabaseName(String databaseName); @Override List<String> transformOutbo... |
### Question:
MetaStoreMappingDecorator implements MetaStoreMapping { @Override public String transformInboundDatabaseName(String databaseName) { return metaStoreMapping.transformInboundDatabaseName(databaseName); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); @Override String transformOutboundDatabase... |
### Question:
MetaStoreMappingDecorator implements MetaStoreMapping { @Override public String transformOutboundDatabaseName(String databaseName) { return metaStoreMapping.transformOutboundDatabaseName(databaseName); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); @Override String transformOutboundDataba... |
### Question:
MetaStoreMappingDecorator implements MetaStoreMapping { @Override public Database transformOutboundDatabase(Database database) { return metaStoreMapping.transformOutboundDatabase(database); } MetaStoreMappingDecorator(MetaStoreMapping metaStoreMapping); @Override String transformOutboundDatabaseName(Strin... |
### Question:
MetaStoreMappingImpl implements MetaStoreMapping { @Override public String transformOutboundDatabaseName(String databaseName) { return databaseName.toLowerCase(Locale.ROOT); } MetaStoreMappingImpl(
String databasePrefix,
String name,
CloseableThriftHiveMetastoreIface client,
Access... |
### Question:
MetaStoreMappingImpl implements MetaStoreMapping { @Override public Database transformOutboundDatabase(Database database) { database.setName(transformOutboundDatabaseName(database.getName())); return database; } MetaStoreMappingImpl(
String databasePrefix,
String name,
CloseableThriftHiv... |
### Question:
MetaStoreMappingImpl implements MetaStoreMapping { @Override public String transformInboundDatabaseName(String databaseName) { return databaseName.toLowerCase(Locale.ROOT); } MetaStoreMappingImpl(
String databasePrefix,
String name,
CloseableThriftHiveMetastoreIface client,
AccessC... |
### Question:
MetaStoreMappingImpl implements MetaStoreMapping { @Override public String getDatabasePrefix() { return databasePrefix; } MetaStoreMappingImpl(
String databasePrefix,
String name,
CloseableThriftHiveMetastoreIface client,
AccessControlHandler accessControlHandler,
ConnectionT... |
### Question:
AbstractMetaStore { public static FederatedMetaStore newFederatedInstance(String name, String remoteMetaStoreUris) { return new FederatedMetaStore(name, remoteMetaStoreUris); } AbstractMetaStore(); AbstractMetaStore(String name, String remoteMetaStoreUris, AccessControlType accessControlType); AbstractM... |
### Question:
MetaStoreMappingImpl implements MetaStoreMapping { @Override public String getMetastoreMappingName() { return name; } MetaStoreMappingImpl(
String databasePrefix,
String name,
CloseableThriftHiveMetastoreIface client,
AccessControlHandler accessControlHandler,
ConnectionType ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.