001/** 002 * 003 * Copyright 2021 Florian Schmaus 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.jivesoftware.smackx.iqversion.packet; 018 019import org.jivesoftware.smack.XMPPConnection; 020import org.jivesoftware.smack.packet.IqBuilder; 021import org.jivesoftware.smack.packet.IqData; 022 023public class VersionBuilder extends IqBuilder<VersionBuilder, Version> implements VersionView { 024 025 private String name; 026 private String version; 027 private String os; 028 029 VersionBuilder(IqData iqCommon) { 030 super(iqCommon); 031 } 032 033 VersionBuilder(XMPPConnection connection) { 034 super(connection); 035 } 036 037 VersionBuilder(String stanzaId) { 038 super(stanzaId); 039 } 040 041 public VersionBuilder setName(String name) { 042 this.name = name; 043 return getThis(); 044 } 045 046 public VersionBuilder setVersion(String version) { 047 this.version = version; 048 return getThis(); 049 } 050 051 public VersionBuilder setOs(String os) { 052 this.os = os; 053 return getThis(); 054 } 055 056 @Override 057 public String getName() { 058 return name; 059 } 060 061 @Override 062 public String getVersion() { 063 return version; 064 } 065 066 @Override 067 public String getOs() { 068 return os; 069 } 070 071 @Override 072 public Version build() { 073 return new Version(this); 074 } 075 076 @Override 077 public VersionBuilder getThis() { 078 return this; 079 } 080}