repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToLongPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToLongPrefixTest { private TypeConverter typeConverter; private TypeConverterConfi...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
config.setSigningType(CopyBookFieldSigningType.PREFIX);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToLongPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToLongPrefixTest { private TypeConverter typeConverter; private TypeConverterConfi...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToIntegerPostfixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToIntegerPostfixTest { private TypeConverter typeConverter; private TypeConverterC...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
config.setSigningType(CopyBookFieldSigningType.POSTFIX);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToIntegerPostfixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToIntegerPostfixTest { private TypeConverter typeConverter; private TypeConverterC...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverterBase.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import java.nio.charset.Charset; import java.util.Arrays;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public abstract class TypeConverterBase implements TypeConverter { protected Charset charset;
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
protected CopyBookFieldSigningType signingType;
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverterBase.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import java.nio.charset.Charset; import java.util.Arrays;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public abstract class TypeConverterBase implements TypeConverter { protected Charset charset; protected CopyB...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
throw new TypeConverterException("Selected charset and padding char is more than 1 byte long");
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperNullValuesTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookFieldFormat; import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.converters.StringToString; import com.nordea.oss.copybook.except...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.serializers; public class CopyBookMapperNullValuesTest { @Rule public ExpectedException expectedEx = ExpectedException....
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
@CopyBookFieldFormat(type = StringToString.class, paddingChar = ' ', nullFillerChar = (byte)0, signingType = CopyBookFieldSigningType.PREFIX, rightPadding = false)
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperNullValuesTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookFieldFormat; import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.converters.StringToString; import com.nordea.oss.copybook.except...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.serializers; public class CopyBookMapperNullValuesTest { @Rule public ExpectedException expectedEx = ExpectedException....
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
CopyBookSerializer serializer = new CopyBookSerializer(fieldTypeStringSetToNullFull.class);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperNullValuesTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookFieldFormat; import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.converters.StringToString; import com.nordea.oss.copybook.except...
} @CopyBook() static public class ObjectFieldInt { @CopyBookLine("01 FIELD PIC 9(2).") public int value; } @CopyBook(type = FullMapper.class) static public class FieldTypeNestedIntNull { @CopyBookLine("01 FIELD.") public ObjectFieldInt field; } @org.jun...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
expectedEx.expect(CopyBookException.class);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/IntegerToTypeConverterIntEnumTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToTypeConverterIntEnumTest { private TypeConverter typeConverter; private TypeConverterC...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToIntegerPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToIntegerPrefixTest { private TypeConverter typeConverter; private TypeConverterCo...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
config.setSigningType(CopyBookFieldSigningType.PREFIX);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToIntegerPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToIntegerPrefixTest { private TypeConverter typeConverter; private TypeConverterCo...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/SignedIntegerToLong.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToLong extends SignedIntegerToInteger { @Override public void validate(Class<?> type...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
if(size > 22 && (this.signingType == CopyBookFieldSigningType.PREFIX || this.signingType == CopyBookFieldSigningType.POSTFIX)) {
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/SignedIntegerToLong.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToLong extends SignedIntegerToInteger { @Override public void validate(Class<?> type...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
throw new TypeConverterException("long is not large enough to hold possible value");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/SignedIntegerToLong.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToLong extends SignedIntegerToInteger { @Override public void validate(Class<?> type...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { // All of value is null filler
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/annotations/CopyBookFieldFormat.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import java.lang.annotation.*;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.annotations; @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, ElementType.FIELD }) @Repeatable(CopyBookFieldFormat...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
Class<? extends TypeConverter> type();
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/annotations/CopyBookFieldFormat.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import java.lang.annotation.*;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.annotations; @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, ElementType.FIELD }) @Repeatable(CopyBookFieldFormat...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
CopyBookFieldSigningType signingType() default CopyBookFieldSigningType.PREFIX;
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookParserMappingExceptionTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/CopyBookException.java // public class CopyBookException extends RuntimeException { // private static final long serialVersionUID = 28118369047109260L; // public CopyBookException(String message) { // super(message); // } // //...
import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.exceptions.CopyBookException; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException;
@CopyBook() public class ArrayOfObjectToStringArray { @CopyBookLine("01 OBJS OCCURS 10 TIMES.") private String[] fields; } @CopyBook() public class IntegerArrayToInteger { @CopyBookLine("01 FIELDS OCCURS 10 TIMES.") @CopyBookLine("02 FIELD PIC 9(8).") privat...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/CopyBookException.java // public class CopyBookException extends RuntimeException { // private static final long serialVersionUID = 28118369047109260L; // public CopyBookException(String message) { // super(message); // } // //...
expectedEx.expect(CopyBookException.class);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToBigIntegerPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.math.BigInteger; import java.nio.charset.StandardCharsets; i...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToBigIntegerPrefixTest { private TypeConverter typeConverter; private TypeConverte...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
config.setSigningType(CopyBookFieldSigningType.PREFIX);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToBigIntegerPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.math.BigInteger; import java.nio.charset.StandardCharsets; i...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToBigIntegerPrefixTest { private TypeConverter typeConverter; private TypeConverte...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/StringToLocalDateTimeTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; import static org.junit.Assert.assertArrayEquals; import static org...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class StringToLocalDateTimeTest { private TypeConverter typeConverter; private TypeConverterConfig co...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedDecimalToBigDecimalPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; i...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedDecimalToBigDecimalPrefixTest { private TypeConverter typeConverter; private TypeConverte...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
config.setSigningType(CopyBookFieldSigningType.PREFIX);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedDecimalToBigDecimalPrefixTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; i...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedDecimalToBigDecimalPrefixTest { private TypeConverter typeConverter; private TypeConverte...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
expectedEx.expect(TypeConverterException.class);
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverterConfig.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookFieldSigningType.java // public enum CopyBookFieldSigningType { // POSTFIX, // PREFIX, // LAST_BYTE_BIT8, // LAST_BYTE_EBCDIC_BIT5 // }
import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import java.nio.charset.Charset;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class TypeConverterConfig { private Charset charset;
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookFieldSigningType.java // public enum CopyBookFieldSigningType { // POSTFIX, // PREFIX, // LAST_BYTE_BIT8, // LAST_BYTE_EBCDIC_BIT5 // } // Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter...
private CopyBookFieldSigningType signingType;
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookField.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.exceptions.CopyBookException; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.serializers; public class CopyBookField { private List<CopyBookField> subCopyBookFields; // TODO: Change to types and Cla...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
private TypeConverter converter;
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookField.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.exceptions.CopyBookException; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List;
this.counterKey = counterKey; this.converter = converter; this.name = name; this.size = size; this.decimals = decimals; this.minOccurs = minOccurs; this.maxOccurs = maxOccurs; } public Object setBytes(Object obj, ByteBuffer buffer, boolean removePadding) ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
throw new CopyBookException(getFieldName() + ": ", ex);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToIntegerLastByteBit8Test.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToIntegerLastByteBit8Test { private TypeConverter typeConverter; private TypeConve...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
config.setSigningType(CopyBookFieldSigningType.LAST_BYTE_BIT8);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/SignedIntegerToIntegerLastByteBit8Test.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.copybook.serializers.CopyBookFieldSigningType; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToIntegerLastByteBit8Test { private TypeConverter typeConverter; private TypeConve...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperFullCharsetTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToString.java // public class StringToString extends TypeConverterBase { // @Override // public void validate(Class<?> type, int size, int decimals) { // if(!(String.class.equals(type))) { // throw new TypeConverte...
import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.converters.StringToString; import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookFieldFormat; import static org.junit.Assert.assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.serializers; public class CopyBookMapperFullCharsetTest { @CopyBook(charset = "cp037", type = FullMapper.class)
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToString.java // public class StringToString extends TypeConverterBase { // @Override // public void validate(Class<?> type, int size, int decimals) { // if(!(String.class.equals(type))) { // throw new TypeConverte...
@CopyBookFieldFormat(type = StringToString.class, paddingChar = ' ', nullFillerChar = (byte)0, signingType = CopyBookFieldSigningType.PREFIX, rightPadding = false)
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperFullCharsetTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToString.java // public class StringToString extends TypeConverterBase { // @Override // public void validate(Class<?> type, int size, int decimals) { // if(!(String.class.equals(type))) { // throw new TypeConverte...
import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.converters.StringToString; import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookFieldFormat; import static org.junit.Assert.assert...
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.serializers; public class CopyBookMapperFullCharsetTest { @CopyBook(charset = "cp037", type = FullMapper.class) @CopyBoo...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToString.java // public class StringToString extends TypeConverterBase { // @Override // public void validate(Class<?> type, int size, int decimals) { // if(!(String.class.equals(type))) { // throw new TypeConverte...
CopyBookSerializer serializer = new CopyBookSerializer(fieldTypeStringCp037.class);
NordeaOSS/copybook4java
copybook4java-codegen-maven-plugin/src/test/java/com/nordea/oss/copybook/codegen/CopyBookConverterTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import org.junit.Rule; import org.junit.rules.ExpectedException; import javax.script.ScriptException; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java...
InputStream rootObjSample = this.getClass().getResourceAsStream("../../../../../rootobj.txt"); convertedJavaSources.addAll(converter.convert(rootObjSample, "mypackage", "RootObj", "none", "UTF-8", "nested", null)); List<String> errors = CompileGeneratedSource(convertedJavaSources); asse...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
sources.add(new String(ByteUtils.toByteArray(new FileInputStream(file)), StandardCharsets.UTF_8));
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToTypeConverterIntEnum.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.util.HashMap; import java.util.Map;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToTypeConverterIntEnum extends IntegerToInteger { Class<?> type; Object[] enumConstants; ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
throw new TypeConverterException("Only supports converting to and from TypeConverterIntEnum");
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/IntegerToLongTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToLongTest { private TypeConverter typeConverter; private TypeConverterConfig config; ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/SignedIntegerToBigInteger.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.math.BigInteger;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToBigInteger extends SignedIntegerToInteger { @Override public void validate(Class<...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
throw new TypeConverterException("Only supports converting to and from BigInteger");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/SignedIntegerToBigInteger.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.math.BigInteger;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class SignedIntegerToBigInteger extends SignedIntegerToInteger { @Override public void validate(Class<...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { // All of value is null filler
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToBoolean.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class StringToBoolean extends StringToString { private String[] values; @Override public void init...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
throw new TypeConverterException("A minimum of two values should be provided in the format with | as seperator");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToInteger.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.ByteUtils;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToInteger extends TypeConverterBase { @Override public void validate(Class<?> type, int si...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
throw new TypeConverterException("int is not large enough to hold possible value");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToInteger.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import com.nordea.oss.ByteUtils;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToInteger extends TypeConverterBase { @Override public void validate(Class<?> type, int si...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { // All of value is null filler
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookParser.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.annotations.*; import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.converters.TypeConverterConfig; import com.nordea.oss.copybook.exceptions.CopyBookException; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.lang.annotation...
private Class<? extends CopyBookMapper> serializerClass = null; private CopyBookSerializerConfig config = new CopyBookSerializerConfig(); public CopyBookParser(Class<?> type) { this(type, false); } public CopyBookParser(Class<?> type, boolean debug) { // Read copybook annotations a...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
throw new CopyBookException("Serialization class missing");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookParser.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.annotations.*; import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.converters.TypeConverterConfig; import com.nordea.oss.copybook.exceptions.CopyBookException; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.lang.annotation...
} public CopyBookParser(Class<?> type, boolean debug) { // Read copybook annotations and defaults List<CopyBook> copybookAnnotations = getAnnotationsRecursively(CopyBookDefaults.class, CopyBook.class); copybookAnnotations.addAll(getAnnotationsRecursively(type, CopyBook.class)); ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
Map<String,TypeConverter> defaultTypeConverterMap = getTypeConvertersRecursively(CopyBookDefaults.class, config.getCharset(), config.isStrict());
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookParser.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.annotations.*; import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.converters.TypeConverterConfig; import com.nordea.oss.copybook.exceptions.CopyBookException; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.lang.annotation...
} // Try to see if we have a convert for any of the interfaces this type implements if (typeConverter == null) { for (Class<?> aInterface : fieldBaseType.getInterfaces()) { typeConverter = fieldTypeConverterM...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
} catch (TypeConverterException ex) {
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/CopyBookParser.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
import com.nordea.oss.copybook.annotations.*; import com.nordea.oss.copybook.converters.TypeConverter; import com.nordea.oss.copybook.converters.TypeConverterConfig; import com.nordea.oss.copybook.exceptions.CopyBookException; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.lang.annotation...
if(annotationType.isInstance(annotation)) { results.add((T)annotation); } else if (annotation.annotationType().getAnnotation(annotationType) != null) { results.addAll(getAnnotationsRecursively(annotation.annotationType(), annotationType)); } }...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/converters/TypeConverter.java // public interface TypeConverter { // void initialize(TypeConverterConfig config); // void validate(Class<?> type, int size, int decimals); // TypeConverter copy(Class<?> type) throws IllegalAccessException, Instanti...
TypeConverterConfig config = new TypeConverterConfig();
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperFullOccursPicSingleLineTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookLine; import java.math.BigDecimal; import static org.junit.Assert.assertArrayEquals;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.serializers; public class CopyBookMapperFullOccursPicSingleLineTest { @CopyBook(type = FullMapper.class) static public ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
CopyBookSerializer serializer = new CopyBookSerializer(StringFieldOccursTwoTimes.class);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperFullTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookLine; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import static org.junit.Assert.assertArrayEquals; import static org.jun...
@CopyBookLine("02 TITLE PIC X(5).") public String title; @CopyBookLine("02 BODY PIC X(10).") public String body; public RequestMessage() { } public RequestMessage(String title, String body) { this.title = title; this.body = body; ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
CopyBookSerializer requestTestSerializer = new CopyBookSerializer(RequestTest.class);
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToBoolean.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToBoolean extends IntegerToInteger { @Override public void validate(Class<?> type, int si...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
throw new TypeConverterException("Only supports converting to and from int or Integer");
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/IntegerToIntegerTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToIntegerTest { private TypeConverter typeConverter; private TypeConverterConfig config;...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToBigInteger.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.math.BigInteger; import java.util.Arrays;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToBigInteger extends IntegerToInteger { @Override public void validate(Class<?> type, int...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
throw new TypeConverterException("Only supports converting to and from BigInteger");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToBigInteger.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.math.BigInteger; import java.util.Arrays;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToBigInteger extends IntegerToInteger { @Override public void validate(Class<?> type, int...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { // All of value is null filler
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/PackedFirstLevelMapper.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.CopyBookException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.List;
writeField(buffer, field, field.getObject(rootObj), last); } } } private void writeField(PackedBuffer buffer, CopyBookField field, Object valueObj, boolean last) { if(field.getLevel() == 0) { buffer.put(field.getBytes(null, valueObj, false), true); // No ...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
throw new CopyBookException("Failed to create new object", e);
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/serializers/PackedFirstLevelMapper.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.CopyBookException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.List;
/* TODO: Calculate the number of set bits with bit masking and Long.numberOfTrailingZeros as this should be quicker String befor = debugBitmap(this.bitmapBytes, 0, 8); ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES); buffer.put(this.bitmapBytes); buffer.f...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
int index = ByteUtils.indexOf(this.buffer.array(), this.separatorByte, this.buffer.position() + 1, maxLength);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperPackedFirstLevelTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.exceptions.CopyBookException; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import sta...
@CopyBookLine("02 TITLE PIC X(5).") public String title; @CopyBookLine("02 BODY PIC X(10).") public String body; public RequestMessage() { } public RequestMessage(String title, String body) { this.title = title; this.body = body; ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
CopyBookSerializer requestTestSerializer = new CopyBookSerializer(RequestTest.class);
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/serializers/CopyBookMapperPackedFirstLevelTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
import com.nordea.oss.copybook.CopyBookSerializer; import com.nordea.oss.copybook.annotations.CopyBook; import com.nordea.oss.copybook.annotations.CopyBookLine; import com.nordea.oss.copybook.exceptions.CopyBookException; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import sta...
RequestTest requestTest = new RequestTest(); requestTest.hellos = new RequestMessage[] { null }; requestTest.hellos_count = requestTest.hellos.length; // Serializer and Deserializer object to and from bytes CopyBookSerializer requestTestSerializer = new CopyBookSerializer(Reques...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/CopyBookSerializer.java // public class CopyBookSerializer { // private CopyBookMapper serializer; // // public CopyBookSerializer(Class<?> type) { // this(type, false); // } // // public CopyBookSerializer(Class<?> type, boolean deb...
expectedEx.expect(CopyBookException.class);
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToString.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.util.Arrays;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class StringToString extends TypeConverterBase { @Override public void validate(Class<?> type, int siz...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
throw new TypeConverterException("Only supports converting to and from String");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/StringToString.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException; import java.util.Arrays;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class StringToString extends TypeConverterBase { @Override public void validate(Class<?> type, int siz...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
if(ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { // All of value is null filler
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToLong.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToLong extends IntegerToInteger { @Override public void validate(Class<?> type, int size, ...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
throw new TypeConverterException("Long is not large enough to hold possible value");
NordeaOSS/copybook4java
copybook4java/src/main/java/com/nordea/oss/copybook/converters/IntegerToLong.java
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
import com.nordea.oss.ByteUtils; import com.nordea.oss.copybook.exceptions.TypeConverterException;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class IntegerToLong extends IntegerToInteger { @Override public void validate(Class<?> type, int size, ...
// Path: copybook4java/src/main/java/com/nordea/oss/ByteUtils.java // public class ByteUtils { // // public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { // maxLength = Math.min(offset + maxLength, array.length); // for(int i = offset; i < maxLength; i++) { // ...
if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { // All of value is null filler
NordeaOSS/copybook4java
copybook4java/src/test/java/com/nordea/oss/copybook/converters/StringToBooleanTest.java
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
import com.nordea.oss.copybook.exceptions.TypeConverterException; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.nio.charset.StandardCharsets; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals;
/* * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Copyright (c) 2016. Nordea Bank AB * Licensed under the MIT license (LICENSE.txt) */ package com.nordea.oss.copybook.converters; public class StringToBooleanTest { private TypeConverter typeConverter; private TypeConverterConfig config; ...
// Path: copybook4java/src/main/java/com/nordea/oss/copybook/exceptions/TypeConverterException.java // public class TypeConverterException extends RuntimeException { // private static final long serialVersionUID = -7577535992947276304L; // public TypeConverterException(String message) { // super(message...
@Test(expected = TypeConverterException.class)
mjuhasz/BDSup2Sub
src/main/java/bdsup2sub/gui/palette/DvdPaletteDialogView.java
// Path: src/main/java/bdsup2sub/gui/support/RequestFocusListener.java // public class RequestFocusListener implements AncestorListener // { // private boolean removeListener; // // /* // * Convenience constructor. The listener is only used once and then it is // * removed from the component. // ...
import bdsup2sub.gui.support.RequestFocusListener; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import java.awt.image.BufferedImage; import static bdsup2sub.gui.support.GuiUtils.centerRelativeToOwner;
/* * Copyright 2014 Miklos Juhasz (mjuhasz) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
// Path: src/main/java/bdsup2sub/gui/support/RequestFocusListener.java // public class RequestFocusListener implements AncestorListener // { // private boolean removeListener; // // /* // * Convenience constructor. The listener is only used once and then it is // * removed from the component. // ...
centerRelativeToOwner(this);
mjuhasz/BDSup2Sub
src/main/java/bdsup2sub/gui/palette/DvdPaletteDialogView.java
// Path: src/main/java/bdsup2sub/gui/support/RequestFocusListener.java // public class RequestFocusListener implements AncestorListener // { // private boolean removeListener; // // /* // * Convenience constructor. The listener is only used once and then it is // * removed from the component. // ...
import bdsup2sub.gui.support.RequestFocusListener; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import java.awt.image.BufferedImage; import static bdsup2sub.gui.support.GuiUtils.centerRelativeToOwner;
centerRelativeToOwner(this); } private JPanel getJContentPane() { if(jContentPane == null) { JLabel lblColor = new JLabel(); jContentPane = new JPanel(); jContentPane.setLayout(null); lblColor.setText("Choose Color"); lblColor.setBound...
// Path: src/main/java/bdsup2sub/gui/support/RequestFocusListener.java // public class RequestFocusListener implements AncestorListener // { // private boolean removeListener; // // /* // * Convenience constructor. The listener is only used once and then it is // * removed from the component. // ...
jButtonOk.addAncestorListener(new RequestFocusListener());
mjuhasz/BDSup2Sub
src/main/java/bdsup2sub/bitmap/Palette.java
// Path: src/main/java/bdsup2sub/bitmap/ColorSpaceUtils.java // public static int[] RGB2YCbCr(int r, int g, int b, boolean useBT601) { // int[] yCbCr = new int[3]; // double y,cb,cr; // // if (useBT601) { // /* BT.601 for RGB 0..255 (PC) -> YCbCr 16..235 */ // y = r * 0.299 * 219 / 255 ...
import java.awt.*; import java.awt.image.ColorModel; import java.awt.image.IndexColorModel; import java.util.Arrays; import static bdsup2sub.bitmap.ColorSpaceUtils.RGB2YCbCr;
/* * Copyright 2014 Volker Oth (0xdeadbeef) / Miklos Juhasz (mjuhasz) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless req...
// Path: src/main/java/bdsup2sub/bitmap/ColorSpaceUtils.java // public static int[] RGB2YCbCr(int r, int g, int b, boolean useBT601) { // int[] yCbCr = new int[3]; // double y,cb,cr; // // if (useBT601) { // /* BT.601 for RGB 0..255 (PC) -> YCbCr 16..235 */ // y = r * 0.299 * 219 / 255 ...
int[] yCbCr = RGB2YCbCr(0, 0, 0, useBT601);
mjuhasz/BDSup2Sub
src/main/java/bdsup2sub/utils/SubtitleUtils.java
// Path: src/main/java/bdsup2sub/core/Framerate.java // public enum Framerate { // FPS_23_976(24000.0/1001, 0x10), //24p // FPS_23_975(23.975, 0x10), // FPS_24(24.0, 0x20), // PAL(25.0, 0x30), // NTSC(30000.0/1001, 0x40), // PAL_I(50.0,0x60), // NTSC_I(60000.0/1001, 0x70); // // private...
import bdsup2sub.core.Framerate; import bdsup2sub.core.Resolution;
/* * Copyright 2014 Volker Oth (0xdeadbeef) / Miklos Juhasz (mjuhasz) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless req...
// Path: src/main/java/bdsup2sub/core/Framerate.java // public enum Framerate { // FPS_23_976(24000.0/1001, 0x10), //24p // FPS_23_975(23.975, 0x10), // FPS_24(24.0, 0x20), // PAL(25.0, 0x30), // NTSC(30000.0/1001, 0x40), // PAL_I(50.0,0x60), // NTSC_I(60000.0/1001, 0x70); // // private...
return Framerate.PAL.getValue();
mjuhasz/BDSup2Sub
src/main/java/bdsup2sub/utils/SubtitleUtils.java
// Path: src/main/java/bdsup2sub/core/Framerate.java // public enum Framerate { // FPS_23_976(24000.0/1001, 0x10), //24p // FPS_23_975(23.975, 0x10), // FPS_24(24.0, 0x20), // PAL(25.0, 0x30), // NTSC(30000.0/1001, 0x40), // PAL_I(50.0,0x60), // NTSC_I(60000.0/1001, 0x70); // // private...
import bdsup2sub.core.Framerate; import bdsup2sub.core.Resolution;
} if (Math.abs(d - Framerate.PAL_I.getValue()) < 0.001) { return Framerate.PAL_I.getValue(); } return d; } /** * Synchronizes a time stamp in 90kHz resolution to the given frame rate. */ public static long syncTimePTS(long timeStamp, double fps, double ...
// Path: src/main/java/bdsup2sub/core/Framerate.java // public enum Framerate { // FPS_23_976(24000.0/1001, 0x10), //24p // FPS_23_975(23.975, 0x10), // FPS_24(24.0, 0x20), // PAL(25.0, 0x30), // NTSC(30000.0/1001, 0x40), // PAL_I(50.0,0x60), // NTSC_I(60000.0/1001, 0x70); // // private...
public static double getDefaultFramerateForResolution(Resolution resolution) {
mjuhasz/BDSup2Sub
src/test/java/bdsup2sub/cli/CommandLineParserTest.java
// Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MAX_FREE_SCALE_FACTOR = 2.0; // // Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MIN_FREE_SCALE_FACTOR = 0.5;
import bdsup2sub.core.*; import org.apache.commons.cli.ParseException; import org.junit.Before; import org.junit.Test; import java.io.File; import java.io.FileOutputStream; import static bdsup2sub.core.Configuration.MAX_FREE_SCALE_FACTOR; import static bdsup2sub.core.Configuration.MIN_FREE_SCALE_FACTOR; import static o...
} @Test public void shouldAcceptValidAlphaCropThresholdArg() throws Exception { subject.parse("--alpha-crop", "75"); assertEquals(75, subject.getAlphaCropThreshold().get().intValue()); } @Test(expected = ParseException.class) public void shouldRejectInvalidScaleXArg() throws Ex...
// Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MAX_FREE_SCALE_FACTOR = 2.0; // // Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MIN_FREE_SCALE_FACTOR = 0.5; // Path: src/test/java/bdsup2sub/cli/CommandLineParserTest.java import bdsup2sub.c...
subject.parse("--scale", String.valueOf(MIN_FREE_SCALE_FACTOR - 1) + ",1");
mjuhasz/BDSup2Sub
src/test/java/bdsup2sub/cli/CommandLineParserTest.java
// Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MAX_FREE_SCALE_FACTOR = 2.0; // // Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MIN_FREE_SCALE_FACTOR = 0.5;
import bdsup2sub.core.*; import org.apache.commons.cli.ParseException; import org.junit.Before; import org.junit.Test; import java.io.File; import java.io.FileOutputStream; import static bdsup2sub.core.Configuration.MAX_FREE_SCALE_FACTOR; import static bdsup2sub.core.Configuration.MIN_FREE_SCALE_FACTOR; import static o...
assertEquals(75, subject.getAlphaCropThreshold().get().intValue()); } @Test(expected = ParseException.class) public void shouldRejectInvalidScaleXArg() throws Exception { subject.parse("--scale", "foo,2"); } @Test(expected = ParseException.class) public void shouldRejectInvalid...
// Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MAX_FREE_SCALE_FACTOR = 2.0; // // Path: src/main/java/bdsup2sub/core/Configuration.java // public static final double MIN_FREE_SCALE_FACTOR = 0.5; // Path: src/test/java/bdsup2sub/cli/CommandLineParserTest.java import bdsup2sub.c...
subject.parse("--scale", "1," + String.valueOf(MAX_FREE_SCALE_FACTOR + 1));
mjuhasz/BDSup2Sub
src/main/java/bdsup2sub/utils/TimeUtils.java
// Path: src/main/java/bdsup2sub/utils/ToolBox.java // public static String leftZeroPad(int value, int width) { // return String.format("%0" + width + "d", value); // }
import java.util.regex.Matcher; import java.util.regex.Pattern; import static bdsup2sub.utils.ToolBox.leftZeroPad;
/* * Copyright 2014 Volker Oth (0xdeadbeef) / Miklos Juhasz (mjuhasz) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless req...
// Path: src/main/java/bdsup2sub/utils/ToolBox.java // public static String leftZeroPad(int value, int width) { // return String.format("%0" + width + "d", value); // } // Path: src/main/java/bdsup2sub/utils/TimeUtils.java import java.util.regex.Matcher; import java.util.regex.Pattern; import static bdsup2sub.uti...
return leftZeroPad(time[0], 2) + ":" + leftZeroPad(time[1], 2) + ":" + leftZeroPad(time[2], 2) + "." + leftZeroPad(time[3], 3);
790710371/bangbanghelper
app/src/main/java/com/mero/wyt_register/receiver/XposedModelIsOrNotInstalled.java
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; import com.mero.wyt_register.Config; import com.mero.wyt_register.MyApplication;
package com.mero.wyt_register.receiver; /** * Created by chenlei on 2016/10/26. */ public class XposedModelIsOrNotInstalled extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("xposed.isInstalledOrNot")){ Log.e("TAG...
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
SharedPreferences sharedPreferences = MyApplication.getMyApplication().getSharedPreferences(Config.ID,Context.MODE_PRIVATE);
790710371/bangbanghelper
app/src/main/java/com/mero/wyt_register/receiver/XposedModelIsOrNotInstalled.java
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; import com.mero.wyt_register.Config; import com.mero.wyt_register.MyApplication;
package com.mero.wyt_register.receiver; /** * Created by chenlei on 2016/10/26. */ public class XposedModelIsOrNotInstalled extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("xposed.isInstalledOrNot")){ Log.e("TAG...
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
SharedPreferences sharedPreferences = MyApplication.getMyApplication().getSharedPreferences(Config.ID,Context.MODE_PRIVATE);
790710371/bangbanghelper
app/src/main/java/com/mero/wyt_register/net/BaseHttpConnection.java
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.URL; import java.net.URLConnection; import android.os.AsyncTask; import android.util.Log; import com.mero.wyt_register.Config; import com.mero.wyt_register.HttpMethod;
package com.mero.wyt_register.net; /** *@项目名称: 简易通注册助手 *@文件名称: BaseHttpConnection.java *@Date: 2016-7-14 *@Copyright: 2016 Technology Mero Inc. All rights reserved. *注意:由Mero开发,禁止外泄以及使用本程序于其他的商业目的 。 */ public class BaseHttpConnection{ private static final String TAG = "baseNetTag";//用于网络访问的TAG日志
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
public BaseHttpConnection(final String url,final HttpMethod httpMethod,final ISuccessCallback successCallback,final IFailedCallback failedCallback,String...params){
790710371/bangbanghelper
app/src/main/java/com/mero/wyt_register/net/BaseHttpConnection.java
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.URL; import java.net.URLConnection; import android.os.AsyncTask; import android.util.Log; import com.mero.wyt_register.Config; import com.mero.wyt_register.HttpMethod;
package com.mero.wyt_register.net; /** *@项目名称: 简易通注册助手 *@文件名称: BaseHttpConnection.java *@Date: 2016-7-14 *@Copyright: 2016 Technology Mero Inc. All rights reserved. *注意:由Mero开发,禁止外泄以及使用本程序于其他的商业目的 。 */ public class BaseHttpConnection{ private static final String TAG = "baseNetTag";//用于网络访问的TAG日志 public BaseHtt...
// Path: app/src/main/java/com/mero/wyt_register/Config.java // public class Config { // public static final String ID="prefs";//当前应用的ID // public static final String CHARSET="UTF-8";//编码格式 // public static final String DEBUGGING="T";//可调试开发阶段标志 // public static final String URL="www.haoma.com";//临时接码平台地址 // publi...
BufferedWriter bufferedWriter=new BufferedWriter(new OutputStreamWriter(conn.getOutputStream(), Config.CHARSET));
Sonoport/freesound-java
src/test/java/com/sonoport/freesound/response/mapping/CommentMapperTest.java
// Path: src/main/java/com/sonoport/freesound/response/Comment.java // public class Comment { // // /** The username of the person making the comment. */ // private String username; // // /** The comment itself. */ // private String comment; // // /** The date/time the comment was made. */ // private Date crea...
import static org.junit.Assert.assertEquals; import java.util.Date; import org.json.JSONObject; import org.junit.Test; import com.sonoport.freesound.response.Comment;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/Comment.java // public class Comment { // // /** The username of the person making the comment. */ // private String username; // // /** The comment itself. */ // private String comment; // // /** The date/time the comment was made. */ // private Date crea...
final Comment comment = mapper.map(commentJSON);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/search/TextSearch.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.SoundPagingQuery;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, "/search/text/");
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/CommentSound.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.mapping.DetailStringMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.POST, PATH, new DetailStringMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/CommentSound.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.mapping.DetailStringMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.POST, PATH, new DetailStringMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/EditSoundDescription.java
// Path: src/main/java/com/sonoport/freesound/response/mapping/DetailStringMapper.java // public class DetailStringMapper extends Mapper<JSONObject, String> { // // @Override // public String map(final JSONObject source) { // return extractFieldValue(source, "detail", String.class); // } // // }
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.response.mapping.DetailStringMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/mapping/DetailStringMapper.java // public class DetailStringMapper extends Mapper<JSONObject, String> { // // @Override // public String map(final JSONObject source) { // return extractFieldValue(source, "detail", String.class); // } // // } // Path: src/m...
super(PATH, oauthToken, new DetailStringMapper());
Sonoport/freesound-java
src/test/java/com/sonoport/freesound/response/mapping/BookmarkCategoryMapperTest.java
// Path: src/main/java/com/sonoport/freesound/response/BookmarkCategory.java // public class BookmarkCategory { // // /** URI of the bookmark category in Freesound. */ // private String url; // // /** Name that the user has given to the bookmark category. */ // private String name; // // /** Number of sounds un...
import static org.junit.Assert.assertEquals; import org.json.JSONObject; import org.junit.Test; import com.sonoport.freesound.response.BookmarkCategory;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/BookmarkCategory.java // public class BookmarkCategory { // // /** URI of the bookmark category in Freesound. */ // private String url; // // /** Name that the user has given to the bookmark category. */ // private String name; // // /** Number of sounds un...
final BookmarkCategory bookmarkCategory = mapper.map(bookmarkCategoryJSON);
Sonoport/freesound-java
src/test/java/com/sonoport/freesound/response/mapping/UploadedSoundDetailsMapperTest.java
// Path: src/main/java/com/sonoport/freesound/response/UploadedSoundDetails.java // public class UploadedSoundDetails { // // /** Detail message received. */ // private String detail; // // /** Id of the uploaded sound. */ // private Integer id; // // /** Filename of the uploaded sound. */ // private String fi...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.json.JSONObject; import org.junit.Test; import com.sonoport.freesound.response.UploadedSoundDetails;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/UploadedSoundDetails.java // public class UploadedSoundDetails { // // /** Detail message received. */ // private String detail; // // /** Id of the uploaded sound. */ // private Integer id; // // /** Filename of the uploaded sound. */ // private String fi...
final UploadedSoundDetails uploadedSoundDetails = mapper.map(uploadedSoundJSON);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/BinaryResponseQuery.java
// Path: src/main/java/com/sonoport/freesound/response/mapping/InputStreamMapper.java // public class InputStreamMapper extends Mapper<InputStream, InputStream> { // // @Override // public InputStream map(final InputStream source) { // return source; // } // // }
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import org.json.JSONException; import org.json.JSONObject; import com.sonoport.freesound.response.mapping.InputStreamMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/mapping/InputStreamMapper.java // public class InputStreamMapper extends Mapper<InputStream, InputStream> { // // @Override // public InputStream map(final InputStream source) { // return source; // } // // } // Path: src/main/java/com/sonoport/freesound/q...
super(httpRequestMethod, path, new InputStreamMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/SimilarSoundsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.SoundPagingQuery;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/user/UserBookmarkCategorySoundsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.SoundPagingQuery;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/pack/PackSoundsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.SoundPagingQuery;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/BookmarkSound.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.mapping.DetailStringMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.POST, PATH, new DetailStringMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/BookmarkSound.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.mapping.DetailStringMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.POST, PATH, new DetailStringMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/other/MeQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.Collections; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.CurrentUser; import com.sonoport.freesound.response.mapping.CurrentUser...
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, "/me/", new CurrentUserMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/other/MeQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.Collections; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.CurrentUser; import com.sonoport.freesound.response.mapping.CurrentUser...
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, "/me/", new CurrentUserMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/user/UserSoundsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.SoundPagingQuery;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/pack/DownloadPack.java
// Path: src/main/java/com/sonoport/freesound/query/BinaryResponseQuery.java // public abstract class BinaryResponseQuery extends Query<InputStream, InputStream> { // // /** Error message to return if a non-JSON-formatted error response is received. */ // protected static final String JSON_EXCEPTION_MESSAGE = "A non...
import java.util.Collections; import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.BinaryResponseQuery; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.OAuthQuery;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/BinaryResponseQuery.java // public abstract class BinaryResponseQuery extends Query<InputStream, InputStream> { // // /** Error message to return if a non-JSON-formatted error response is received. */ // protected static final String JSON_EXCEPTION_MESSAGE = "A non...
super(HTTPRequestMethod.GET, PATH);
Sonoport/freesound-java
src/test/java/com/sonoport/freesound/response/mapping/CurrentUserMapperTest.java
// Path: src/main/java/com/sonoport/freesound/response/CurrentUser.java // public class CurrentUser extends User { // // /** Unique identifier associated with the user. */ // private Integer uniqueIdentifier; // // /** Email address of the user. */ // private String email; // // /** // * @return the uniqueIde...
import static org.junit.Assert.assertEquals; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.json.JSONObject; import org.junit.Test; import com.sonoport.freesound.response.CurrentUser;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/CurrentUser.java // public class CurrentUser extends User { // // /** Unique identifier associated with the user. */ // private Integer uniqueIdentifier; // // /** Email address of the user. */ // private String email; // // /** // * @return the uniqueIde...
final CurrentUser currentUser = mapper.map(currentUserJSON);
Sonoport/freesound-java
src/test/java/com/sonoport/freesound/response/mapping/AccessTokenDetailsMapperTest.java
// Path: src/main/java/com/sonoport/freesound/response/AccessTokenDetails.java // public class AccessTokenDetails { // // /** The OAuth2 token that can be used as a credential for making calls to protected resources. */ // private String accessToken; // // /** Scope(s) associated with the credential. */ // privat...
import static org.junit.Assert.assertEquals; import org.json.JSONObject; import org.junit.Test; import com.sonoport.freesound.response.AccessTokenDetails;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/AccessTokenDetails.java // public class AccessTokenDetails { // // /** The OAuth2 token that can be used as a credential for making calls to protected resources. */ // private String accessToken; // // /** Scope(s) associated with the credential. */ // privat...
final AccessTokenDetails accessTokenDetails = mapper.map(accessTokenJSON);
Sonoport/freesound-java
src/test/java/com/sonoport/freesound/response/mapping/PackMapperTest.java
// Path: src/main/java/com/sonoport/freesound/response/Pack.java // public class Pack { // // /** The unique identifier of this pack. */ // private int id; // // /** The URI for this pack on the Freesound website. */ // private String url; // // /** The description the user gave to the pack (if any). */ // pri...
import static org.junit.Assert.assertEquals; import java.util.Date; import org.json.JSONObject; import org.junit.Test; import com.sonoport.freesound.response.Pack;
package com.sonoport.freesound.response.mapping; /** * Unit tests to ensure the correct operation of {@link PackMapper}. Test data is located as * <code>/src/test/resources/pack.json</code>. */ public class PackMapperTest extends MapperTest { /** Id of the pack. */ private static final int ID = 15292; /** ...
// Path: src/main/java/com/sonoport/freesound/response/Pack.java // public class Pack { // // /** The unique identifier of this pack. */ // private int id; // // /** The URI for this pack on the Freesound website. */ // private String url; // // /** The description the user gave to the pack (if any). */ // pri...
final Pack pack = packMapper.map(packJSON);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/response/Sound.java
// Path: src/main/java/com/sonoport/freesound/License.java // public enum License { // // /** Creative Commons 0 (Public Domain) license. */ // CC_0("Creative Commons 0", "http://creativecommons.org/publicdomain/zero/"), // // /** Creative Commons By-Attribution license. */ // CC_ATTRIBUTION("Attribution", "http:...
import java.util.Date; import java.util.Map; import java.util.Set; import com.sonoport.freesound.License;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/License.java // public enum License { // // /** Creative Commons 0 (Public Domain) license. */ // CC_0("Creative Commons 0", "http://creativecommons.org/publicdomain/zero/"), // // /** Creative Commons By-Attribution license. */ // CC_ATTRIBUTION("Attribution", "http:...
private License license;
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/RateSound.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.mapping.DetailStringMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.POST, PATH, new DetailStringMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/RateSound.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.mapping.DetailStringMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.POST, PATH, new DetailStringMapper());
Sonoport/freesound-java
src/test/java/com/sonoport/freesound/response/mapping/AudioDescriptorsMapperTest.java
// Path: src/main/java/com/sonoport/freesound/response/AudioDescriptors.java // public class AudioDescriptors { // // /** Fixed length descriptors that take a single value (e.g. pitch). */ // private Set<String> fixedLengthOneDimensional; // // /** Fixed length descriptors that take a multiple values (e.g. mfcc). ...
import static org.junit.Assert.assertTrue; import org.json.JSONObject; import org.junit.Test; import com.sonoport.freesound.response.AudioDescriptors;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/response/AudioDescriptors.java // public class AudioDescriptors { // // /** Fixed length descriptors that take a single value (e.g. pitch). */ // private Set<String> fixedLengthOneDimensional; // // /** Fixed length descriptors that take a multiple values (e.g. mfcc). ...
final AudioDescriptors audioDescriptors = mapper.map(audioDescriptorsJSON);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/DownloadSound.java
// Path: src/main/java/com/sonoport/freesound/query/BinaryResponseQuery.java // public abstract class BinaryResponseQuery extends Query<InputStream, InputStream> { // // /** Error message to return if a non-JSON-formatted error response is received. */ // protected static final String JSON_EXCEPTION_MESSAGE = "A non...
import java.util.Collections; import java.util.HashMap; import java.util.Map; import com.sonoport.freesound.query.BinaryResponseQuery; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.OAuthQuery;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/BinaryResponseQuery.java // public abstract class BinaryResponseQuery extends Query<InputStream, InputStream> { // // /** Error message to return if a non-JSON-formatted error response is received. */ // protected static final String JSON_EXCEPTION_MESSAGE = "A non...
super(HTTPRequestMethod.GET, REQUEST_PATH);
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/other/AvailableAudioDescriptorsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.Collections; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.response.AudioDescriptors; import com.sonoport.freesound.response.mapping.AudioDescriptorsMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH, new AudioDescriptorsMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/other/AvailableAudioDescriptorsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.Collections; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.response.AudioDescriptors; import com.sonoport.freesound.response.mapping.AudioDescriptorsMapper;
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH, new AudioDescriptorsMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/PendingUploadsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.Collections; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.PendingUploads; import com.sonoport.freesound.response.mapping.PendingU...
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH, new PendingUploadsMapper());
Sonoport/freesound-java
src/main/java/com/sonoport/freesound/query/sound/PendingUploadsQuery.java
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
import java.util.Collections; import java.util.Map; import com.sonoport.freesound.query.HTTPRequestMethod; import com.sonoport.freesound.query.JSONResponseQuery; import com.sonoport.freesound.query.OAuthQuery; import com.sonoport.freesound.response.PendingUploads; import com.sonoport.freesound.response.mapping.PendingU...
/* * Copyright 2014 Sonoport (Asia) Pte Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// Path: src/main/java/com/sonoport/freesound/query/HTTPRequestMethod.java // public enum HTTPRequestMethod { // // /** HTTP GET. */ // GET, // // /** HTTP POST. */ // POST, // // /** HTTP PUT. */ // PUT, // // /** HTTP DELETE. */ // DELETE, // // /** HTTP PATCH. */ // PATCH, // // /** HTTP HEAD. */ //...
super(HTTPRequestMethod.GET, PATH, new PendingUploadsMapper());
hprange/woinject
src/test/java/com/woinject/AbstractInjectableTestCase.java
// Path: src/test/java/com/woinject/stubs/StubApplication.java // public class StubApplication extends InjectableApplication { // private static class StubModule extends AbstractModule { // private boolean moduleWasLoaded = false; // // @Override // protected void configure() { // ...
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import com.webobjects.foundation.NSBundle; import com.woinject.stubs.StubApplication;
/** * Copyright (C) 2010 hprange <hprange@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicab...
// Path: src/test/java/com/woinject/stubs/StubApplication.java // public class StubApplication extends InjectableApplication { // private static class StubModule extends AbstractModule { // private boolean moduleWasLoaded = false; // // @Override // protected void configure() { // ...
protected StubApplication application;
hprange/woinject
src/test/java/com/woinject/TestWOInjectModule.java
// Path: src/test/java/com/woinject/stubs/StubSession.java // public class StubSession extends ERXSession { // @Inject // @Named("test") // private String injectedText; // // @Override // public String toString() { // return injectedText; // } // }
import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import java.lang.annotation.Annotation; import java.util.Map; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRu...
/** * Copyright (C) 2010 hprange <hprange@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicab...
// Path: src/test/java/com/woinject/stubs/StubSession.java // public class StubSession extends ERXSession { // @Inject // @Named("test") // private String injectedText; // // @Override // public String toString() { // return injectedText; // } // } // Path: src/test/java/com/woinject/...
private StubSession mockSession;