Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12451 kshitij.so 1
package com.amazonaws.mws.model;
2
 
3
import java.util.Collection;
4
import java.util.HashSet;
5
 
6
/*
7
 * Enumeration of valid content types for a feed submission.
8
 */
9
public enum ContentType {
10
	/*
11
	 * Feed is sent as a stream of bytes ("application/octet-stream").
12
	 * Currently this is the only content type supported by MWS.
13
	 */
14
	OctetStream("application/octet-stream");
15
 
16
	private String value;
17
	private Collection<ContentTypeParameter> parameters = new HashSet<ContentTypeParameter>();
18
 
19
	private ContentType(String s) {
20
		this.value = s;
21
	}
22
 
23
	@SuppressWarnings("unused")
24
	private void addParameter(ContentTypeParameter parameter) {
25
		parameters.add(parameter);		
26
	}
27
 
28
	@Override
29
	public String toString() {
30
		StringBuilder sb = new StringBuilder();
31
 
32
		sb.append(this.value);
33
 
34
		for(ContentTypeParameter p : parameters) {
35
			sb.append(";").append(p);
36
		}
37
 
38
		return sb.toString();
39
	}
40
 
41
}