@Override public String toString() { return "message " + getFullName(); }
@Override public String toString() { return "message " + getFullName(); }
/** * Returns the well-known type kind, or NONE if its not one. */ public WellKnownType getWellKnownType() { if (!isMessage()) { return WellKnownType.NONE; } WellKnownType wkt = WELL_KNOWN_TYPE_MAP.get(messageType.getFullName()); return wkt == null ? WellKnownType.NONE : wkt; }
/** * Returns the well-known type kind, or NONE if its not one. */ public WellKnownType getWellKnownType() { if (!isMessage()) { return WellKnownType.NONE; } WellKnownType wkt = WELL_KNOWN_TYPE_MAP.get(messageType.getFullName()); return wkt == null ? WellKnownType.NONE : wkt; }
/** Returns the Google common type kind, or NONE if its not one. */ public GoogleCommonType getGoogleCommonType() { if (!isMessage()) { return GoogleCommonType.NONE; } GoogleCommonType type = GOOGLE_COMMON_TYPE_MAP.get(messageType.getFullName()); return type == null ? GoogleCommonType.NONE : type; }
/** Returns the Google common type kind, or NONE if its not one. */ public GoogleCommonType getGoogleCommonType() { if (!isMessage()) { return GoogleCommonType.NONE; } GoogleCommonType type = GOOGLE_COMMON_TYPE_MAP.get(messageType.getFullName()); return type == null ? GoogleCommonType.NONE : type; }
/** Helper to access the full name of the input (request) message of a method. */ public static String getInputMessageName(Method method) { return method.getInputType().getMessageType().getFullName(); } }
/** Helper to access the full name of the input (request) message of a method. */ public static String getInputMessageName(Method method) { return method.getInputType().getMessageType().getFullName(); } }
@Override public String getOutputFullName() { return method.getOutputType().getMessageType().getFullName(); }
@Override public String getTypeFullName() { return protoField.getType().getMessageType().getFullName(); }
@Override public String getInputFullName() { return method.getInputType().getMessageType().getFullName(); }
/** Helper to access the full name of the input (request) message of a method. */ public static String getInputMessageName(Method method) { return method.getInputType().getMessageType().getFullName(); }
/** Helper to access the full name of the input (request) message of a method. */ public static String getInputMessageName(Method method) { return method.getInputType().getMessageType().getFullName(); }
public static boolean s_isEmptyType(TypeRef type) { return type.isMessage() && type.getMessageType().getFullName().equals(Empty.getDescriptor().getFullName()); } }
private static java.lang.String generateTypeUrl(TypeRef type) { java.lang.String name; if (type.isMessage()) { name = type.getMessageType().getFullName(); } else { name = type.getEnumType().getFullName(); } return DescriptorNormalization.TYPE_SERVICE_BASE_URL + "/" + name; }
private static java.lang.String generateTypeUrl(TypeRef type) { java.lang.String name; if (type.isMessage()) { name = type.getMessageType().getFullName(); } else { name = type.getEnumType().getFullName(); } return DescriptorNormalization.TYPE_SERVICE_BASE_URL + "/" + name; }
@Override @Test public void testGetFullName_message() { MessageType outer = getOuterMessage(); MessageType inner = getInnerMessage(); assertEquals("OuterMessage", outer.getFullName()); assertEquals("OuterMessage.InnerMessage", inner.getFullName()); } }
@Test public void testGetFullName_message() { MessageType outer = getOuterMessage(); MessageType inner = getInnerMessage(); assertEquals("test.ProtoFileTest.OuterMessage", outer.getFullName()); assertEquals("test.ProtoFileTest.OuterMessage.InnerMessage", inner.getFullName()); }
private void checkResponseObject(Method method, MethodKind kind) { if (kind != MethodKind.NONE) { WellKnownType wkt = TypeRef.of(method.getOutputMessage()).getWellKnownType(); if (!wkt.allowedAsHttpRequestResponse()) { error( ResolvedLocation.create(method.getLocation()), "type '%s' is not allowed as a response because it does not render as " + "a JSON object.", method.getOutputMessage().getFullName()); } } }
private void checkResponseObject(Method method, MethodKind kind) { if (kind != MethodKind.NONE) { WellKnownType wkt = TypeRef.of(method.getOutputMessage()).getWellKnownType(); if (!wkt.allowedAsHttpRequestResponse()) { error( ResolvedLocation.create(method.getLocation()), "type '%s' is not allowed as a response because it does not render as " + "a JSON object.", method.getOutputMessage().getFullName()); } } }