当前位置: 首页>>代码示例>>Java>>正文


Java PrimitiveSink.putBoolean方法代码示例

本文整理汇总了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);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:21,代码来源:OFBsnSetPktinSuppressionRequestVer12.java

示例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);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:21,代码来源:OFBsnSetPktinSuppressionRequestVer13.java

示例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);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:21,代码来源:OFBsnSetPktinSuppressionRequestVer10.java

示例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);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:19,代码来源:OFBsnSetL2TableReplyVer10.java

示例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)
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:19,代码来源:OFBsnSetL2TableRequestVer10.java

示例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);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:21,代码来源:OFBsnSetPktinSuppressionRequestVer11.java

示例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);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:21,代码来源:OFBsnSetPktinSuppressionRequestVer14.java

示例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);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:17,代码来源:PrimitiveSinkUtils.java

示例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);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:12,代码来源:PrimitiveSinkUtils.java

示例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();
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:58,代码来源:TestFieldHasherProcessor.java


注:本文中的com.google.common.hash.PrimitiveSink.putBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。