All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.astyanax.model.AbstractColumnImpl Maven / Gradle / Ivy

There is a newer version: 3.10.2
Show newest version
package com.netflix.astyanax.model;

import java.nio.ByteBuffer;
import java.util.Date;
import java.util.UUID;

import com.netflix.astyanax.Serializer;
import com.netflix.astyanax.serializers.BooleanSerializer;
import com.netflix.astyanax.serializers.ByteBufferSerializer;
import com.netflix.astyanax.serializers.ByteSerializer;
import com.netflix.astyanax.serializers.BytesArraySerializer;
import com.netflix.astyanax.serializers.DateSerializer;
import com.netflix.astyanax.serializers.DoubleSerializer;
import com.netflix.astyanax.serializers.FloatSerializer;
import com.netflix.astyanax.serializers.IntegerSerializer;
import com.netflix.astyanax.serializers.LongSerializer;
import com.netflix.astyanax.serializers.ShortSerializer;
import com.netflix.astyanax.serializers.StringSerializer;
import com.netflix.astyanax.serializers.UUIDSerializer;

public abstract class AbstractColumnImpl  implements Column {
    private final C name;

    public AbstractColumnImpl(C name) {
        this.name = name;
    }

    @Override
    public final C getName() {
        return name;
    }

    @Override
    public final String getStringValue() {
        return getValue(StringSerializer.get());
    }

    @Override
    public final byte getByteValue() {
        return getValue(ByteSerializer.get());
    }
    
    @Override
    public final short getShortValue() {
        return getValue(ShortSerializer.get());
    }
    
    @Override
    public final int getIntegerValue() {
        return getValue(IntegerSerializer.get());
    }

    @Override
    public long getLongValue() {
        return getValue(LongSerializer.get());
    }

    @Override
    public final byte[] getByteArrayValue() {
        return getValue(BytesArraySerializer.get());
    }

    @Override
    public final boolean getBooleanValue() {
        return getValue(BooleanSerializer.get());
    }

    @Override
    public final ByteBuffer getByteBufferValue() {
        return getValue(ByteBufferSerializer.get());
    }

    @Override
    public final Date getDateValue() {
        return getValue(DateSerializer.get());
    }

    @Override
    public final UUID getUUIDValue() {
        return getValue(UUIDSerializer.get());
    }

    @Override
    public final float getFloatValue() {
        return getValue(FloatSerializer.get());
    }
    
    @Override
    public final double getDoubleValue() {
        return getValue(DoubleSerializer.get());
    }

    @Override
    public final String getCompressedStringValue() {
        throw new UnsupportedOperationException("getCompressedString not yet implemented");
    }

    @Override
    public  ColumnList getSubColumns(Serializer ser) {
        throw new UnsupportedOperationException("SimpleColumn \'" + name + "\' has no children");
    }

    @Override
    public boolean isParentColumn() {
        return false;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy