package com.example.scaffold.learning.reflection;

import java.util.List;
import java.util.Map;

public class ReflectionLabTarget {
    private String name = "default-name";
    private int count = 3;
    private final List<String> tags = List.of("spring", "reflection", "proxy");

    public ReflectionLabTarget() {
    }

    public ReflectionLabTarget(String name, int count) {
        this.name = name;
        this.count = count;
    }

    public String greet(String prefix) {
        return prefix + ", " + name + " x" + count;
    }

    private String secretFormula(String input) {
        return "secret:" + input + ":" + (count * 7);
    }

    public static Map<String, Object> staticInfo() {
        return Map.of(
                "topic", "reflection",
                "message", "静态方法也可以通过反射调用"
        );
    }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public int getCount() { return count; }
    public void setCount(int count) { this.count = count; }
    public List<String> getTags() { return tags; }
}
