EMMA Coverage Report (generated Mon Jan 28 10:01:43 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 2012 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 
25public class ElasticsearchEntityInformationCreatorImpl implements ElasticsearchEntityInformationCreator {
26 
27        private final MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext;
28 
29        public ElasticsearchEntityInformationCreatorImpl(
30            MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) {
31                Assert.notNull(mappingContext);
32                this.mappingContext = mappingContext;
33        }
34 
35        @Override
36        @SuppressWarnings("unchecked")
37        public <T, ID extends Serializable> ElasticsearchEntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
38        ElasticsearchPersistentEntity<T> persistentEntity = (ElasticsearchPersistentEntity<T>) mappingContext
39                                .getPersistentEntity(domainClass);
40                return new MappingElasticsearchEntityInformation<T, ID>(persistentEntity);
41        }
42 
43}

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