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 an app endpoint used in a {@link ConnectAction} 022 * @since 5.4.0 023 */ 024@JsonInclude(value = JsonInclude.Include.NON_NULL) 025public class AppEndpoint implements Endpoint { 026 027 private static final String TYPE = "app"; 028 private String user; 029 030 private AppEndpoint(Builder builder) { 031 this.user = builder.user; 032 } 033 034 public String getType() { 035 return TYPE; 036 } 037 038 public String getUser() { 039 return user; 040 } 041 042 public static Builder builder(String user) { 043 return new Builder(user); 044 } 045 046 public static class Builder { 047 private String user; 048 049 public Builder(String user) { 050 this.user = user; 051 } 052 053 public AppEndpoint build() { 054 return new AppEndpoint(this); 055 } 056 } 057}