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 1&1 Internet AG, https://github.com/1and1/
*
* 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://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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 net.oneandone.troilus;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import net.oneandone.troilus.java7.Record;
import com.datastax.driver.core.TupleValue;
import com.google.common.collect.ImmutableList;
/**
* A name which defines the class type of the associated value type
*
* @param the value type
*/
public abstract class ColumnName {
private final String name;
private ColumnName(String name) {
this.name = name;
}
/**
* @return the name
*/
public String getName() {
return name;
}
abstract T read(Record record);
/**
* defines a new name
*
* @param name the name
* @param type the value type
* @param the name type
* @return a new instance
*/
public static ColumnName define(String name, Class type) {
return new SkalarName<>(name, type);
}
/**
* defines a new list name
*
* @param name the name
* @param elementType the list member value type
* @param the name type
* @return a new instance
*/
public static ColumnName> defineList(String name, Class elementType) {
return new ListName<>(name, elementType);
}
/**
* defines a new set name
*
* @param name the name
* @param elementType the set member value type
* @param the name type
* @return a new instance
*/
public static ColumnName> defineSet(String name, Class elementType) {
return new SetName<>(name, elementType);
}
/**
* defines a new set name
*
* @param name the name
* @param keyType the set member key type
* @param valueType the set member value type
* @param the member key name type
* @param the member value type
* @return a new instance
*/
public static ColumnName