You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
3.4 KiB
116 lines
3.4 KiB
package com.fr.plugin.file.submit.oss.fun; |
|
|
|
import com.fanruan.api.xml.XmlKit; |
|
import com.fanruan.api.util.AssistKit; |
|
import com.fanruan.api.util.StringKit; |
|
import com.fr.stable.xml.XMLPrintWriter; |
|
import com.fr.stable.xml.XMLable; |
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
public class OssSubmitTarget implements XMLable { |
|
|
|
public static final String XML_TAG = "OssSubmitTarget"; |
|
|
|
private String bucket; |
|
private OssVariableValue directory; |
|
private OssVariableValue file; |
|
private OssVariableValue name; |
|
|
|
public OssSubmitTarget() { |
|
} |
|
|
|
public OssSubmitTarget(final String bucket, final OssVariableValue directory, final OssVariableValue file, final OssVariableValue name) { |
|
this.bucket = bucket; |
|
this.directory = directory; |
|
this.file = file; |
|
this.name = name; |
|
} |
|
|
|
public String getBucket() { |
|
return this.bucket; |
|
} |
|
|
|
public void setBucket(final String bucket) { |
|
this.bucket = bucket; |
|
} |
|
|
|
public OssVariableValue getDirectory() { |
|
return directory; |
|
} |
|
|
|
public void setDirectory(OssVariableValue directory) { |
|
this.directory = directory; |
|
} |
|
|
|
public OssVariableValue getName() { |
|
return this.name; |
|
} |
|
|
|
public void setName(final OssVariableValue name) { |
|
this.name = name; |
|
} |
|
|
|
public OssVariableValue getFile() { |
|
return this.file; |
|
} |
|
|
|
public void setFile(final OssVariableValue file) { |
|
this.file = file; |
|
} |
|
|
|
public void readXML(final XMLableReader reader) { |
|
if (reader.isChildNode()) { |
|
String tagName = reader.getTagName(); |
|
if ("Bucket".equals(tagName)) { |
|
this.bucket = reader.getElementValue(); |
|
} else if ("Directory".equals(tagName)) { |
|
this.directory = (OssVariableValue) XmlKit.readXMLable(reader); |
|
} else if ("Name".equals(tagName)) { |
|
this.name = (OssVariableValue) XmlKit.readXMLable(reader); |
|
} else if ("File".equals(tagName)) { |
|
this.file = (OssVariableValue) XmlKit.readXMLable(reader); |
|
} |
|
} |
|
} |
|
|
|
public void writeXML(final XMLPrintWriter writer) { |
|
if (StringKit.isNotEmpty(bucket)) { |
|
writer.startTAG("Bucket").textNode(bucket).end(); |
|
} |
|
if (directory != null) { |
|
XmlKit.writeXMLable(writer, directory, "Directory"); |
|
} |
|
if (name != null) { |
|
XmlKit.writeXMLable(writer, name, "Name"); |
|
} |
|
if (file != null) { |
|
XmlKit.writeXMLable(writer, file, "File"); |
|
} |
|
} |
|
|
|
@Override |
|
public boolean equals(final Object o) { |
|
return o instanceof OssSubmitTarget |
|
&& AssistKit.equals(((OssSubmitTarget) o).bucket, bucket) |
|
&& AssistKit.equals(((OssSubmitTarget) o).directory, directory) |
|
&& AssistKit.equals(((OssSubmitTarget) o).name, name) |
|
&& AssistKit.equals(((OssSubmitTarget) o).file, file); |
|
} |
|
|
|
@Override |
|
public Object clone() throws CloneNotSupportedException { |
|
OssSubmitTarget cloned = (OssSubmitTarget) super.clone(); |
|
cloned.bucket = bucket; |
|
if (directory != null) { |
|
cloned.directory = (OssVariableValue) directory.clone(); |
|
} |
|
if (name != null) { |
|
cloned.name = (OssVariableValue) name.clone(); |
|
} |
|
if (file != null) { |
|
cloned.file = (OssVariableValue) file.clone(); |
|
} |
|
return cloned; |
|
} |
|
} |
|
|
|
|