| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package com.example.data_structure.vo;
- import org.springframework.stereotype.Component;
- @Component
- public class Bar {
- private int value;
- private String color;
- public Bar(int value, String color) {
- this.value = value;
- this.color = color;
- }
- public Bar() {
- }
- //getter
- public int getValue() {
- return value;
- }
- public String getColor() {
- return color;
- }
- //setter
- public void setValue(int value) {
- this.value = value;
- }
- public void setColor(String color) {
- this.color = color;
- }
- //toString
- @Override
- public String toString() {
- return "Bar{" +
- "value=" + value +
- ", color='" + color + '\'' +
- '}';
- }
- //copy
- public static Bar copyBar(Bar bar){
- Bar copyBar=new Bar(bar.getValue(),bar.getColor());
- return copyBar;
- }
- }
|