Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2014-2015 Amazon Technologies, Inc.
  *
  * 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://aws.amazon.com/apache2.0
  *
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
 * OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and
 * limitations under the License.
 */
package com.amazonaws.services.dynamodbv2.datamodeling;
A strategy for mapping between Java types and DynamoDB types. Serves as a factory for ItemConverter instances that implement this mapping. Standard implementations are available in the ConversionSchemas class.
public interface ConversionSchema {

    
Dependency injection for the ItemConverters that this ConversionSchema generates.
    static class Dependencies {
        private final Map<Class<?>, Objectvalues;
        public Dependencies() {
             = new HashMap<Class<?>, Object>();
        }
        @SuppressWarnings("unchecked")
        public <T> T get(Class<T> clazz) {
            return (T) .get(clazz);
        }
        public <T> Dependencies with(Class<T> clazz, T value) {
            .put(clazzvalue);
            return this;
        }
        @Override
        public String toString() {
            return .toString();
        }
    }

    
Creates an ItemConverter, injecting dependencies from the DynamoDBMapper that needs it.

Parameters:
dependencies the dependencies to inject
Returns:
a new ItemConverter
    ItemConverter getConverter(Dependencies dependencies);
New to GrepCode? Check out our FAQ X