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


Java Internal类代码示例

本文整理汇总了Java中com.google.protobuf.Internal的典型用法代码示例。如果您正苦于以下问题:Java Internal类的具体用法?Java Internal怎么用?Java Internal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Internal类属于com.google.protobuf包,在下文中一共展示了Internal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unpack

import com.google.protobuf.Internal; //导入依赖的package包/类
public static <T extends Message> T unpack(AxAnyProto.AxAny any, Class<T> message) throws InvalidProtocolBufferException {
    T var1 = Internal.getDefaultInstance(message);
    if (!is(any, var1)) {
        throw new InvalidProtocolBufferException("Type of the Any message does not match the given class.");
    }
    T result = (T) var1.getParserForType()
            .parseFrom(any.getValue());
    return result;
}
 
开发者ID:ogcs,项目名称:Okra-Ax,代码行数:10,代码来源:AxAnyUtil.java

示例2: ReferenceValidator

import com.google.protobuf.Internal; //导入依赖的package包/类
ReferenceValidator(Enricher enricher,
        Class<? extends Message> eventClass,
        Class<? extends Message> enrichmentClass) {
    this.enricher = enricher;
    this.eventDescriptor = Internal.getDefaultInstance(eventClass)
                                   .getDescriptorForType();
    this.enrichmentDescriptor = Internal.getDefaultInstance(enrichmentClass)
                                        .getDescriptorForType();
}
 
开发者ID:SpineEventEngine,项目名称:core-java,代码行数:10,代码来源:ReferenceValidator.java

示例3: apply

import com.google.protobuf.Internal; //导入依赖的package包/类
@Override
public T apply(S eventMsg, C context) {
    checkNotNull(eventMsg);
    checkNotNull(context);
    ensureActive();
    verifyOwnState();

    final T defaultTarget = Internal.getDefaultInstance(getEnrichmentClass());
    final Message.Builder builder = defaultTarget.toBuilder();
    setFields(builder, eventMsg, context);
    @SuppressWarnings("unchecked") // types are checked during the initialization and validation
    final T result = (T) builder.build();
    return result;
}
 
开发者ID:SpineEventEngine,项目名称:core-java,代码行数:15,代码来源:MessageEnrichment.java

示例4: calculateHashCodeForObject

import com.google.protobuf.Internal; //导入依赖的package包/类
/**
 * Calculate hash code for object.
 *
 * @param a the a
 * @return the int
 */
private static int calculateHashCodeForObject(Object a) {
    if (a instanceof byte[]) {
        return Internal.hashCode((byte[]) a);
    }
    // Enums should be stored as integers internally.
    if (a instanceof EnumLite) {
        throw new UnsupportedOperationException();
    }
    return a.hashCode();
}
 
开发者ID:jhunters,项目名称:jprotobuf,代码行数:17,代码来源:MapFieldLite.java

示例5: fromFieldNumbers

import com.google.protobuf.Internal; //导入依赖的package包/类
/**
 * Constructs a FieldMask from the passed field numbers.
 *
 * @throws IllegalArgumentException if any of the fields are invalid for the message.
 */
public static FieldMask fromFieldNumbers(
    Class<? extends Message> type, Iterable<Integer> fieldNumbers) {
  Descriptor descriptor = Internal.getDefaultInstance(type).getDescriptorForType();

  FieldMask.Builder builder = FieldMask.newBuilder();
  for (Integer fieldNumber : fieldNumbers) {
    FieldDescriptor field = descriptor.findFieldByNumber(fieldNumber);
    checkArgument(
        field != null,
        String.format("%s is not a valid field number for %s.", fieldNumber, type));
    builder.addPaths(field.getName());
  }
  return builder.build();
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:20,代码来源:FieldMaskUtil.java

示例6: match

import com.google.protobuf.Internal; //导入依赖的package包/类
@Override
public boolean match(Internal.EnumLite forward, Internal.EnumLite opcode) {
    return DOMAIN.MATCHING_VALUE == forward.getNumber() && REQUEST_OPCODE.JOIN_MATCH_QUENE.equals(opcode);
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:5,代码来源:MatchingJoinMatch.java

示例7: match

import com.google.protobuf.Internal; //导入依赖的package包/类
@Override
public boolean match(Internal.EnumLite forward, Internal.EnumLite opcode) {
    return forward.getNumber() == DOMAIN.MATCHING_VALUE
            && NOTIFY_OPCODE.NOTIFY_MATCH_SUCCESS.getNumber() == opcode.getNumber();
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:6,代码来源:MatchingWaitForMatchStatus.java

示例8: match

import com.google.protobuf.Internal; //导入依赖的package包/类
@Override
public boolean match(Internal.EnumLite forward, Internal.EnumLite opcode) {
    return forward.getNumber() == DOMAIN.MATCHING_VALUE && opcode.getNumber() == REQUEST_OPCODE.JOIN_MATCH_QUENE_VALUE;
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:5,代码来源:MatchingWaitForJoinRoom.java

示例9: error

import com.google.protobuf.Internal; //导入依赖的package包/类
public static ResponseBodyMessage<String> error(Internal.EnumLite code) {
    Preconditions.checkArgument(code.getNumber() > 0);
    return success(code, null);
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:5,代码来源:ResponseBodyMessage.java

示例10: success

import com.google.protobuf.Internal; //导入依赖的package包/类
public static <T extends Serializable> ResponseBodyMessage<T> success(Internal.EnumLite code, T data) {
    return new ResponseBodyMessage<>(code.getNumber(), data);
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:4,代码来源:ResponseBodyMessage.java

示例11: error

import com.google.protobuf.Internal; //导入依赖的package包/类
public static ResponseBodyEntity<String> error(Internal.EnumLite code) {
    return success(code, null);
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:4,代码来源:ResponseBodyEntity.java

示例12: success

import com.google.protobuf.Internal; //导入依赖的package包/类
public static <T> ResponseBodyEntity<T> success(Internal.EnumLite code, T data) {
    return new ResponseBodyEntity<>(code.getNumber(), data);
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:4,代码来源:ResponseBodyEntity.java

示例13: ServiceEmptyMessage

import com.google.protobuf.Internal; //导入依赖的package包/类
private ServiceEmptyMessage(Internal.EnumLite errorCode) {
    this.errorCode = errorCode;
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:4,代码来源:ServiceEmptyMessage.java

示例14: newMessage

import com.google.protobuf.Internal; //导入依赖的package包/类
public static ServiceEmptyMessage newMessage(Internal.EnumLite errorCode) {
    return newMessage(errorCode);
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:4,代码来源:ServiceEmptyMessage.java

示例15: getErrorCode

import com.google.protobuf.Internal; //导入依赖的package包/类
public Internal.EnumLite getErrorCode() {
    return errorCode;
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:4,代码来源:ServiceEmptyMessage.java


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