Examples of targetType()


Examples of info.archinnov.achilles.codec.Codec.targetType()

        log.debug("Parse list codec for field {}", field);
        if (filter.hasAnnotation(field, TypeTransformer.class)) {
            return typeTransformerParser.parseAndValidateListCodec(field);
        } else {
            final Codec simpleCodec = createSimpleCodecForCollection(context);
            return new ListCodecImpl(simpleCodec.sourceType(), simpleCodec.targetType(), simpleCodec);
        }
    }

    SetCodec parseSetField(PropertyParsingContext context) {
        final Field field = context.getCurrentField();
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.targetType()

        log.debug("Parse set codec for field {}", field);
        if (filter.hasAnnotation(field, TypeTransformer.class)) {
            return typeTransformerParser.parseAndValidateSetCodec(field);
        } else {
            final Codec simpleCodec = createSimpleCodecForCollection(context);
            return new SetCodecImpl(simpleCodec.sourceType(), simpleCodec.targetType(), simpleCodec);
        }
    }

    MapCodec parseMapField(PropertyParsingContext context) {
        final Field field = context.getCurrentField();
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.targetType()

            return MapCodecBuilder.fromKeyType(keyCodec.sourceType())
                    .toKeyType(keyCodec.targetType())
                    .withKeyCodec(keyCodec)
                    .fromValueType(valueCodec.sourceType())
                    .toValueType(valueCodec.targetType())
                    .withValueCodec(valueCodec);
        }

    }
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.targetType()

        //When
        final Codec codec = factory.parseSimpleField(createContext(field));

        //Then
        assertThat(codec.sourceType()).isSameAs(Long.class);
        assertThat(codec.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_create_enum_name_codec() throws Exception {
        //Given
View Full Code Here

Examples of info.archinnov.achilles.codec.Codec.targetType()

        final Codec actual = parser.parseAndValidateSimpleCodec(Test.class.getDeclaredField("longToString"));

        //Then
        assertThat(actual).isInstanceOf(LongToStringCodec.class);
        assertThat(actual.sourceType()).isSameAs(Long.class);
        assertThat(actual.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_exception_when_codec_class_not_instance_of_codec() throws Exception {
        //Given
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.ListCodec.targetType()

        //When
        final ListCodec codec = factory.parseListField(createContext(field));

        //Then
        assertThat(codec.sourceType()).isSameAs(Long.class);
        assertThat(codec.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_create_set_codec() throws Exception {
        class Test {
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.ListCodec.targetType()

    @Test
    public void should_determine_cql3_list_type() throws Exception {
        //Given
        ListCodec listCodec = mock(ListCodec.class);
        when(listCodec.sourceType()).thenReturn(Integer.class);
        when(listCodec.targetType()).thenReturn(String.class);

        //When
        final Class<?> actualClass = factory.determineCQL3ValueType(listCodec, false);

        //Then
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.ListCodec.targetType()

        //When
        final ListCodec actual = parser.parseAndValidateListCodec(Test.class.getDeclaredField("longToString"));

        //Then
        assertThat(actual.sourceType()).isSameAs(Long.class);
        assertThat(actual.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_exception_when_source_type_not_match_for_list_codec() throws Exception {
        //Given
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.SetCodec.targetType()

        //When
        final SetCodec codec = factory.parseSetField(createContext(field));

        //Then
        assertThat(codec.sourceType()).isSameAs(Long.class);
        assertThat(codec.targetType()).isSameAs(String.class);
    }

    @Test
    public void should_create_map_codec() throws Exception {
        class Test {
View Full Code Here

Examples of info.archinnov.achilles.internal.metadata.codec.SetCodec.targetType()

    @Test
    public void should_determine_cql3_set_type() throws Exception {
        //Given
        SetCodec setCodec = mock(SetCodec.class);
        when(setCodec.sourceType()).thenReturn(Integer.class);
        when(setCodec.targetType()).thenReturn(String.class);

        //When
        final Class<?> actualClass = factory.determineCQL3ValueType(setCodec, false);

        //Then
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.