Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2015-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.FailedBatch;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import com.amazonaws.services.dynamodbv2.model.CreateTableRequest;
import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest;
import com.amazonaws.services.s3.model.Region;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* Abstract implementation of {@code IDynamoDBMapper}. Convenient method forms pass through to the
* corresponding overload that takes a request object, which throws an
* {@code UnsupportedOperationException}.
*/
public class AbstractDynamoDBMapper implements IDynamoDBMapper {
private final DynamoDBMapperConfig config;
protected AbstractDynamoDBMapper(final DynamoDBMapperConfig defaults) {
this.config = DynamoDBMapperConfig.DEFAULT.merge(defaults);
}
protected AbstractDynamoDBMapper() {
this(DynamoDBMapperConfig.DEFAULT);
}
protected final String getTableName(Class> clazz, Object object, DynamoDBMapperConfig config) {
if (config.getObjectTableNameResolver() != null && object != null) {
return config.getObjectTableNameResolver().getTableName(object, config);
}
return getTableName(clazz, config);
}
protected final String getTableName(Class> clazz, DynamoDBMapperConfig config) {
if (config.getTableNameResolver() == null) {
return DynamoDBMapperConfig.DefaultTableNameResolver.INSTANCE.getTableName(clazz, config);
}
return config.getTableNameResolver().getTableName(clazz, config);
}
protected final DynamoDBMapperConfig mergeConfig(DynamoDBMapperConfig overrides) {
return this.config.merge(overrides);
}
@Override
public DynamoDBMapperTableModel getTableModel(Class clazz) {
return getTableModel(clazz, config);
}
@Override
public DynamoDBMapperTableModel getTableModel(Class clazz, DynamoDBMapperConfig config) {
throw new UnsupportedOperationException("operation not supported in " + getClass());
}
@Override
public T load(Class clazz, Object hashKey, DynamoDBMapperConfig config) {
return load(clazz, hashKey, (Object)null, config);
}
@Override
public T load(Class clazz, Object hashKey) {
return load(clazz, hashKey, (Object)null, config);
}
@Override
public T load(Class clazz, Object hashKey, Object rangeKey) {
return load(clazz, hashKey, rangeKey, config);
}
@Override
public T load(Class clazz, Object hashKey, Object rangeKey, DynamoDBMapperConfig config) {
throw new UnsupportedOperationException("operation not supported in " + getClass());
}
@Override
public T load(T keyObject) {
return load(keyObject, config);
}
@Override
public T load(T keyObject, DynamoDBMapperConfig config) {
throw new UnsupportedOperationException("operation not supported in " + getClass());
}
@Override
public T marshallIntoObject(Class clazz, Map itemAttributes) {
return marshallIntoObject(clazz, itemAttributes, config);
}
public T marshallIntoObject(Class clazz, Map itemAttributes, DynamoDBMapperConfig config) {
throw new UnsupportedOperationException("operation not supported in " + getClass());
}
@Override
public List marshallIntoObjects(Class clazz, List