remove old code
This commit is contained in:
@@ -1,31 +1,5 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Amenity implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
public Amenity(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Amenity)) {
|
||||
return false;
|
||||
}
|
||||
Amenity a = (Amenity) obj;
|
||||
return name.equals(a.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return name.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
public enum Amenity {
|
||||
OCEAN_VIEW, LATE_CHECKOUT, MINIBAR;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ public class ApplicationConversionService extends DefaultConversionService {
|
||||
StringToDate dateConverter = new StringToDate();
|
||||
dateConverter.setPattern("MM-dd-yyyy");
|
||||
addConverter("shortDate", dateConverter);
|
||||
addConverter(new StringToAmenity());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
@@ -187,12 +186,6 @@ public class Booking implements Serializable {
|
||||
}
|
||||
|
||||
public void setAmenities(Set<Amenity> amenities) {
|
||||
Iterator<Amenity> it = amenities.iterator();
|
||||
while (it.hasNext()) {
|
||||
Object a = it.next();
|
||||
System.out.println(a);
|
||||
System.out.println(a.getClass());
|
||||
}
|
||||
this.amenities = amenities;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
import org.springframework.binding.convert.converters.StringToObject;
|
||||
|
||||
public class StringToAmenity extends StringToObject {
|
||||
|
||||
public StringToAmenity() {
|
||||
super(Amenity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object toObject(String string, Class tagetClass) throws Exception {
|
||||
return new Amenity(string);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String toString(Object value) throws Exception {
|
||||
return ((Amenity) value).getName();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user