本文整理汇总了Java中com.google.common.hash.PrimitiveSink.putBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java PrimitiveSink.putBoolean方法的具体用法?Java PrimitiveSink.putBoolean怎么用?Java PrimitiveSink.putBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.hash.PrimitiveSink
的用法示例。
在下文中一共展示了PrimitiveSink.putBoolean方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: funnel
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
@Override
public void funnel(OFBsnSetPktinSuppressionRequestVer12 message, PrimitiveSink sink) {
// fixed value property version = 3
sink.putByte((byte) 0x3);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// fixed value property length = 32
sink.putShort((short) 0x20);
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0xbL
sink.putInt(0xb);
sink.putBoolean(message.enabled);
// skip pad (1 bytes)
sink.putInt(message.idleTimeout);
sink.putInt(message.hardTimeout);
sink.putInt(message.priority);
message.cookie.putTo(sink);
}
示例2: funnel
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
@Override
public void funnel(OFBsnSetPktinSuppressionRequestVer13 message, PrimitiveSink sink) {
// fixed value property version = 4
sink.putByte((byte) 0x4);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// fixed value property length = 32
sink.putShort((short) 0x20);
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0xbL
sink.putInt(0xb);
sink.putBoolean(message.enabled);
// skip pad (1 bytes)
sink.putInt(message.idleTimeout);
sink.putInt(message.hardTimeout);
sink.putInt(message.priority);
message.cookie.putTo(sink);
}
示例3: funnel
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
@Override
public void funnel(OFBsnSetPktinSuppressionRequestVer10 message, PrimitiveSink sink) {
// fixed value property version = 1
sink.putByte((byte) 0x1);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// fixed value property length = 32
sink.putShort((short) 0x20);
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0xbL
sink.putInt(0xb);
sink.putBoolean(message.enabled);
// skip pad (1 bytes)
sink.putInt(message.idleTimeout);
sink.putInt(message.hardTimeout);
sink.putInt(message.priority);
message.cookie.putTo(sink);
}
示例4: funnel
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
@Override
public void funnel(OFBsnSetL2TableReplyVer10 message, PrimitiveSink sink) {
// fixed value property version = 1
sink.putByte((byte) 0x1);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// fixed value property length = 24
sink.putShort((short) 0x18);
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0x18L
sink.putInt(0x18);
sink.putBoolean(message.l2TableEnable);
// skip pad (1 bytes)
sink.putInt(message.l2TablePriority);
sink.putLong(message.status);
}
示例5: funnel
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
@Override
public void funnel(OFBsnSetL2TableRequestVer10 message, PrimitiveSink sink) {
// fixed value property version = 1
sink.putByte((byte) 0x1);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// fixed value property length = 24
sink.putShort((short) 0x18);
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0xcL
sink.putInt(0xc);
sink.putBoolean(message.l2TableEnable);
// skip pad (1 bytes)
sink.putInt(message.l2TablePriority);
// skip pad (4 bytes)
}
示例6: funnel
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
@Override
public void funnel(OFBsnSetPktinSuppressionRequestVer11 message, PrimitiveSink sink) {
// fixed value property version = 2
sink.putByte((byte) 0x2);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// fixed value property length = 32
sink.putShort((short) 0x20);
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0xbL
sink.putInt(0xb);
sink.putBoolean(message.enabled);
// skip pad (1 bytes)
sink.putInt(message.idleTimeout);
sink.putInt(message.hardTimeout);
sink.putInt(message.priority);
message.cookie.putTo(sink);
}
示例7: funnel
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
@Override
public void funnel(OFBsnSetPktinSuppressionRequestVer14 message, PrimitiveSink sink) {
// fixed value property version = 5
sink.putByte((byte) 0x5);
// fixed value property type = 4
sink.putByte((byte) 0x4);
// fixed value property length = 32
sink.putShort((short) 0x20);
sink.putLong(message.xid);
// fixed value property experimenter = 0x5c16c7L
sink.putInt(0x5c16c7);
// fixed value property subtype = 0xbL
sink.putInt(0xb);
sink.putBoolean(message.enabled);
// skip pad (1 bytes)
sink.putInt(message.idleTimeout);
sink.putInt(message.hardTimeout);
sink.putInt(message.priority);
message.cookie.putTo(sink);
}
示例8: putNullableStringTo
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
/** puts a nullable String into a primitive sink. The entry is prepended by a 'presence'
* boolean bit and the string length;
*
*
* @param sink the sink to put the object
* @param nullableObj the potentially null string to put in the sink
*/
public static void putNullableStringTo(PrimitiveSink sink,
@Nullable CharSequence nullableChars) {
sink.putBoolean(nullableChars != null);
if(nullableChars != null) {
sink.putInt(nullableChars.length());
sink.putUnencodedChars(nullableChars);
}
}
示例9: putNullableTo
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
/** puts a nullable element into a primitive sink. The entry is prepended by a 'present' bit.
*
* @param sink the sink to put the object
* @param nullableObj the nullable object
*/
public static void putNullableTo(PrimitiveSink sink,
@Nullable PrimitiveSinkable nullableObj) {
sink.putBoolean(nullableObj != null);
if(nullableObj != null)
nullableObj.putTo(sink);
}
示例10: computeHash
import com.google.common.hash.PrimitiveSink; //导入方法依赖的package包/类
private String computeHash(Field.Type fieldType, Object value, HashType hashType) {
HashFunction hasher = HashingUtil.getHasher(hashType.getHashType());
PrimitiveSink sink = hasher.newHasher();
switch (fieldType) {
case BOOLEAN:
sink.putBoolean(new BooleanTypeSupport().convert(value));
break;
case CHAR:
sink.putChar(new CharTypeSupport().convert(value));
break;
case BYTE:
sink.putByte(new ByteTypeSupport().convert(value));
break;
case SHORT:
sink.putShort(new ShortTypeSupport().convert(value));
break;
case INTEGER:
sink.putInt(new IntegerTypeSupport().convert(value));
break;
case LONG:
sink.putLong(new LongTypeSupport().convert(value));
break;
case FLOAT:
sink.putFloat(new FloatTypeSupport().convert(value));
break;
case DOUBLE:
sink.putDouble(new DoubleTypeSupport().convert(value));
break;
case DATE:
sink.putLong(new DateTypeSupport().convert(value).getTime());
break;
case TIME:
sink.putLong(new DateTypeSupport().convert(value).getTime());
break;
case DATETIME:
sink.putLong(new DateTypeSupport().convert(value).getTime());
break;
case DECIMAL:
sink.putString(new StringTypeSupport().convert(value), Charset.defaultCharset());
break;
case STRING:
sink.putString(new StringTypeSupport().convert(value), Charset.defaultCharset());
break;
case BYTE_ARRAY:
sink.putBytes(new ByteArrayTypeSupport().convert(value));
break;
case MAP:
case LIST:
default:
return null;
}
// this was the problem in SDC-6540.
sink.putByte((byte)0);
return ((Hasher)sink).hash().toString();
}