added iterator sample
This commit is contained in:
25
iterator/src/main/java/com/iluwatar/Item.java
Normal file
25
iterator/src/main/java/com/iluwatar/Item.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public class Item {
|
||||
|
||||
private ItemType type;
|
||||
private String name;
|
||||
|
||||
public Item(ItemType type, String name) {
|
||||
this.setType(type);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ItemType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(ItemType type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user