@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MethodTarget that = (MethodTarget) o; if (!method.equals(that.method)) return false; if (!bean.equals(that.bean)) return false; if (!help.equals(that.help)) return false; return help.equals(that.help); }
public MethodTarget(Method method, Object bean, Help help, Supplier<Availability> availabilityIndicator) { Assert.notNull(method, "Method cannot be null"); Assert.notNull(bean, "Bean cannot be null"); Assert.hasText(help.getDescription(), String.format("Help cannot be blank when trying to define command based on '%s'", method)); ReflectionUtils.makeAccessible(method); this.method = method; this.bean = bean; this.help = help; this.availabilityIndicator = availabilityIndicator != null ? availabilityIndicator : () -> Availability.available(); }
public String getGroup() { return help.getGroup(); }
public String getHelp() { return help.getDescription(); }
public MethodTarget(Method method, Object bean, String help) { this(method, bean, new Help(help, null), null); }
public MethodTarget(Method method, Object bean, String help, Supplier<Availability> availabilityIndicator) { this(method, bean, new Help(help, null), availabilityIndicator); }