Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Редактирование заявок.
- *
- * @param fresh новая заявка.
- */
- public void update(Item fresh) {
- for (int index = 0; index != items.length; ++index) {
- if (items[index].getId().equals(fresh.getId())) {
- items[index] = fresh;
- break;
- }
- }
- }
- private void changeItem() {
- System.out.println("------------ Изменения заявки --------------");
- String newname = this.input.ask("Введите имя заявки :");
- String newdesc = this.input.ask("Введите описание заявки :");
- Item newItem = new Item(newname, newdesc, System.currentTimeMillis());
- newItem.setId(tracker.getAll()[0].getId());
- this.tracker.update(newItem);
- }
- public class Item implements Cloneable {
- /**
- * Поле имя.
- */
- private String name;
- /**
- * Поле описание.
- */
- private String description;
- /**
- * Поле создание.
- */
- private Long create;
- /**
- * Поле id.
- */
- private String id;
- /**
- * Конструктор класса Item.
- *
- * @param name имя.
- * @param description описание.
- * @param create создание.
- */
- public Item(String name, String description, Long create) {
- this.name = name;
- this.description = description;
- this.create = create;
- }
- @Override
- public String toString() {
- String s = "name = " + name + "n" + "description = " + description;
- return s;
- }
- /**
- * GetName.
- *
- * @return String
- */
- public String getName() {
- return name;
- }
- /**
- * SetName.
- *
- * @param name имя.
- */
- public void setName(String name) {
- this.name = name;
- }
- /**
- * GetDescription.
- *
- * @return String
- */
- public String getDescription() {
- return description;
- }
- /**
- * SetDescription.
- *
- * @param description описание.
- */
- public void setDescription(String description) {
- this.description = description;
- }
- /**
- * GetCreate.
- *
- * @return Long
- */
- public Long getCreate() {
- return create;
- }
- /**
- * SetCreate.
- *
- * @param create создание.
- */
- public void setCreate(Long create) {
- this.create = create;
- }
- /**
- * GetId.
- *
- * @return String
- */
- public String getId() {
- return id;
- }
- /**
- * SetId.
- *
- * @param id id.
- */
- public void setId(String id) {
- this.id = id;
- }
- }
Add Comment
Please, Sign In to add comment