Package io.spine.net

Class Uri

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, UriOrBuilder, io.spine.validate.ValidatableMessage, Serializable

    public final class Uri
    extends com.google.protobuf.GeneratedMessageV3
    implements io.spine.validate.ValidatableMessage, UriOrBuilder
     A URL in a structured form.
     This type represents URL according to RFC 3986.
     Using this type makes it easier to operate concrete URL attributes.
     Please see https://tools.ietf.org/html/rfc3986.
     This type is intended to be used only by parsing or validating utilities.
     For general purpose usage, please use `Url`.
     
    Protobuf type spine.net.Uri
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Uri.Authorization
      Pair of the username (email commonly) and password (optional) (e.g.
      static interface  Uri.AuthorizationOrBuilder  
      static class  Uri.Builder
      A URL in a structured form.
      static class  Uri.Protocol
      Application layer protocol.
      static interface  Uri.ProtocolOrBuilder  
      static class  Uri.QueryParameter
      Url query parameter type.
      static interface  Uri.QueryParameterOrBuilder  
      static class  Uri.Schema
      Most often used application layer protocols.
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,​BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,​BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

        com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasProtocol

        public boolean hasProtocol()
         Application layer protocol.
         
        .spine.net.Uri.Protocol protocol = 1;
        Specified by:
        hasProtocol in interface UriOrBuilder
        Returns:
        Whether the protocol field is set.
      • getProtocol

        public Uri.Protocol getProtocol()
         Application layer protocol.
         
        .spine.net.Uri.Protocol protocol = 1;
        Specified by:
        getProtocol in interface UriOrBuilder
        Returns:
        The protocol.
      • hasAuth

        public boolean hasAuth()
         User's email and password (both optional).
         
        .spine.net.Uri.Authorization auth = 2 [(.required) = false, (.validate) = true];
        Specified by:
        hasAuth in interface UriOrBuilder
        Returns:
        Whether the auth field is set.
      • getAuth

        public Uri.Authorization getAuth()
         User's email and password (both optional).
         
        .spine.net.Uri.Authorization auth = 2 [(.required) = false, (.validate) = true];
        Specified by:
        getAuth in interface UriOrBuilder
        Returns:
        The auth.
      • getHost

        public String getHost()
         Domain name.
         
        string host = 3;
        Specified by:
        getHost in interface UriOrBuilder
        Returns:
        The host.
      • getHostBytes

        public com.google.protobuf.ByteString getHostBytes()
         Domain name.
         
        string host = 3;
        Specified by:
        getHostBytes in interface UriOrBuilder
        Returns:
        The bytes for host.
      • getPort

        public String getPort()
         Server's port (e.g. :8080).
         We leave port as string, because port 0 is hypothetically possible to use.
         
        string port = 4;
        Specified by:
        getPort in interface UriOrBuilder
        Returns:
        The port.
      • getPortBytes

        public com.google.protobuf.ByteString getPortBytes()
         Server's port (e.g. :8080).
         We leave port as string, because port 0 is hypothetically possible to use.
         
        string port = 4;
        Specified by:
        getPortBytes in interface UriOrBuilder
        Returns:
        The bytes for port.
      • getPath

        public String getPath()
         Relative path to desired resource (e.g. "/index" or "/js/app.js").
         
        string path = 5;
        Specified by:
        getPath in interface UriOrBuilder
        Returns:
        The path.
      • getPathBytes

        public com.google.protobuf.ByteString getPathBytes()
         Relative path to desired resource (e.g. "/index" or "/js/app.js").
         
        string path = 5;
        Specified by:
        getPathBytes in interface UriOrBuilder
        Returns:
        The bytes for path.
      • getQueryCount

        public int getQueryCount()
         A list of key-value pairs (?key1=value1&key2=value2).
         
        repeated .spine.net.Uri.QueryParameter query = 6;
        Specified by:
        getQueryCount in interface UriOrBuilder
      • getQuery

        public Uri.QueryParameter getQuery​(int index)
         A list of key-value pairs (?key1=value1&key2=value2).
         
        repeated .spine.net.Uri.QueryParameter query = 6;
        Specified by:
        getQuery in interface UriOrBuilder
      • getFragment

        public String getFragment()
         Sub-resource (e.g. "#article").
         
        string fragment = 7;
        Specified by:
        getFragment in interface UriOrBuilder
        Returns:
        The fragment.
      • getFragmentBytes

        public com.google.protobuf.ByteString getFragmentBytes()
         Sub-resource (e.g. "#article").
         
        string fragment = 7;
        Specified by:
        getFragmentBytes in interface UriOrBuilder
        Returns:
        The bytes for fragment.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Uri parseFrom​(ByteBuffer data)
                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Uri parseFrom​(ByteBuffer data,
                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Uri parseFrom​(com.google.protobuf.ByteString data)
                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Uri parseFrom​(com.google.protobuf.ByteString data,
                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Uri parseFrom​(byte[] data)
                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Uri parseFrom​(byte[] data,
                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseDelimitedFrom

        public static Uri parseDelimitedFrom​(InputStream input,
                                             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                      throws IOException
        Throws:
        IOException
      • parseFrom

        public static Uri parseFrom​(com.google.protobuf.CodedInputStream input)
                             throws IOException
        Throws:
        IOException
      • parseFrom

        public static Uri parseFrom​(com.google.protobuf.CodedInputStream input,
                                    com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                             throws IOException
        Throws:
        IOException
      • newBuilderForType

        public Uri.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • newBuilder

        public static Uri.Builder newBuilder​(Uri prototype)
      • toBuilder

        public Uri.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Uri.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • validate

        public Optional<io.spine.validate.ValidationError> validate()
        Specified by:
        validate in interface io.spine.validate.ValidatableMessage
      • getDefaultInstance

        public static Uri getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<Uri> parser()
      • getParserForType

        public com.google.protobuf.Parser<Uri> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Uri getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder