EMMA Coverage Report (generated Tue Mar 05 16:36:55 GMT 2013)
[all classes][org.springframework.data.elasticsearch.repository.support]

COVERAGE SUMMARY FOR SOURCE FILE [ElasticsearchEntityInformationCreatorImpl.java]

nameclass, %method, %block, %line, %
ElasticsearchEntityInformationCreatorImpl.java100% (1/1)100% (2/2)100% (19/19)100% (6/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ElasticsearchEntityInformationCreatorImpl100% (1/1)100% (2/2)100% (19/19)100% (6/6)
ElasticsearchEntityInformationCreatorImpl (MappingContext): void 100% (1/1)100% (8/8)100% (4/4)
getEntityInformation (Class): ElasticsearchEntityInformation 100% (1/1)100% (11/11)100% (2/2)

1/*
2 * Copyright 2013 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.springframework.data.elasticsearch.repository.support;
17 
18import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity;
19import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty;
20import org.springframework.data.mapping.context.MappingContext;
21import org.springframework.util.Assert;
22 
23import java.io.Serializable;
24 
25/**
26 * ElasticsearchEntityInformationCreatorImpl
27 *
28 * @author Rizwan Idrees
29 * @author Mohsin Husen
30 */
31public class ElasticsearchEntityInformationCreatorImpl implements ElasticsearchEntityInformationCreator {
32 
33        private final MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext;
34 
35        public ElasticsearchEntityInformationCreatorImpl(
36            MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) {
37                Assert.notNull(mappingContext);
38                this.mappingContext = mappingContext;
39        }
40 
41        @Override
42        @SuppressWarnings("unchecked")
43        public <T, ID extends Serializable> ElasticsearchEntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
44        ElasticsearchPersistentEntity<T> persistentEntity = (ElasticsearchPersistentEntity<T>) mappingContext
45                                .getPersistentEntity(domainClass);
46                return new MappingElasticsearchEntityInformation<T, ID>(persistentEntity);
47        }
48 
49}

[all classes][org.springframework.data.elasticsearch.repository.support]
EMMA 2.0.5312 (C) Vladimir Roubtsov