case SET_RAW:
case RAW:
{
// We want to create the index regardless
IndexType iType = IndexType.typeFromFullname(f.getIndexName());
RawIndex rawIndex = container.getIndex(RawIndex.named(f.getIndexName(), iType));
if (val != null)
{
if (f.getFieldType() == RiakIndexField.FieldType.SET_RAW)
{
for (byte[] bytes : (Set<byte[]>) val)
{
rawIndex.add(BinaryValue.create(bytes));
}
}
else
{
rawIndex.add(BinaryValue.create((byte[])val));
}
}
}
default:
break;
}
}
for (RiakIndexMethod m : indexMethods)
{
Object val;
switch (m.getMethodType())
{
case SET_LONG_GETTER:
case LONG_GETTER:
val = getMethodValue(m.getMethod(), obj);
// We want to create the index regardless
LongIntIndex index = container.getIndex(LongIntIndex.named(m.getIndexName()));
if (val != null)
{
if (m.getMethodType() == RiakIndexMethod.MethodType.SET_LONG_GETTER)
{
index.add((Set<Long>) val);
}
else
{
index.add((Long) val);
}
}
break;
case SET_STRING_GETTER:
case STRING_GETTER:
val = getMethodValue(m.getMethod(), obj);
// We want to create the index regardless
StringBinIndex stringBinIndex = container.getIndex(StringBinIndex.named(m.getIndexName()));
if (val != null)
{
if (m.getMethodType() == RiakIndexMethod.MethodType.SET_STRING_GETTER)
{
stringBinIndex.add((Set<String>) val);
}
else
{
stringBinIndex.add((String) val);
}
}
break;
case SET_BIG_INT_GETTER:
case BIG_INT_GETTER:
val = getMethodValue(m.getMethod(), obj);
// We want to create the index regardless
BigIntIndex bigIntIndex = container.getIndex(BigIntIndex.named(m.getIndexName()));
if (val != null)
{
if (m.getMethodType() == RiakIndexMethod.MethodType.SET_BIG_INT_GETTER)
{
bigIntIndex.add((Set<BigInteger>) val);
}
else
{
bigIntIndex.add((BigInteger) val);
}
}
break;
case SET_RAW_GETTER:
case RAW_GETTER:
val = getMethodValue(m.getMethod(), obj);
IndexType iType = IndexType.typeFromFullname(m.getIndexName());
RawIndex rawIndex = container.getIndex(RawIndex.named(m.getIndexName(), iType));
if (val != null)
{
if (m.getMethodType() == RiakIndexMethod.MethodType.SET_RAW_GETTER)
{
for (byte[] bytes : (Set<byte[]>) val)
{
rawIndex.add(BinaryValue.create(bytes));
}
}
else
{
rawIndex.add(BinaryValue.create((byte[]) val));
}
}
default:
break;
}