1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.fourthline.cling.support.model.dlna.message.header;
16
17 import org.fourthline.cling.model.message.header.InvalidHeaderException;
18 import org.fourthline.cling.model.types.InvalidValueException;
19 import org.fourthline.cling.support.avtransport.lastchange.AVTransportVariable.TransportPlaySpeed;
20
21
22
23
24 public class PlaySpeedHeader extends DLNAHeader<TransportPlaySpeed> {
25
26 public PlaySpeedHeader() {
27 }
28
29 public PlaySpeedHeader(TransportPlaySpeed speed) {
30 setValue(speed);
31 }
32
33 @Override
34 public void setString(String s) throws InvalidHeaderException {
35 if (s.length() != 0) {
36 try {
37 TransportPlaySpeed t = new TransportPlaySpeed(s);
38 setValue(t);
39 return;
40 } catch (InvalidValueException invalidValueException) {}
41 }
42 throw new InvalidHeaderException("Invalid PlaySpeed header value: " + s);
43 }
44
45 @Override
46 public String getString() {
47 return getValue().getValue();
48 }
49 }