001/*
002 *   Copyright 2020 Vonage
003 *
004 *   Licensed under the Apache License, Version 2.0 (the "License");
005 *   you may not use this file except in compliance with the License.
006 *   You may obtain a copy of the License at
007 *
008 *        http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *   Unless required by applicable law or agreed to in writing, software
011 *   distributed under the License is distributed on an "AS IS" BASIS,
012 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *   See the License for the specific language governing permissions and
014 *   limitations under the License.
015 */
016package com.vonage.client.voice.ncco;
017
018import com.fasterxml.jackson.annotation.JsonInclude;
019
020/**
021 * Represents a SIP endpoint used in a {@link ConnectAction}
022 */
023@JsonInclude(value = JsonInclude.Include.NON_NULL)
024public class SipEndpoint implements Endpoint {
025    private static final String TYPE = "sip";
026
027    private String uri;
028
029    private SipEndpoint(Builder builder) {
030        this.uri = builder.uri;
031    }
032
033    @Override
034    public String getType() {
035        return TYPE;
036    }
037
038    public String getUri() {
039        return uri;
040    }
041
042    public static Builder builder(String uri) {
043        return new Builder(uri);
044    }
045
046    public static class Builder {
047        private String uri;
048
049        public Builder(String uri) {
050            this.uri = uri;
051        }
052
053        public Builder uri(String uri) {
054            this.uri = uri;
055            return this;
056        }
057
058        public SipEndpoint build() {
059            return new SipEndpoint(this);
060        }
061    }
062}