Skip to content

MetaController traversing #14

Description

@ariscript

Given an interface like:

public interface MetaController<T extends SendableMotorController> extends SendableMotorController {
    T getController();
}

where T can itself be MetaController<U> (where U is not T), I need a method that can traverse this chain and return the class that is at the bottom of the chain (i.e., not something implementing MetaController).
Knowing Java's type system limitations, it likely can't return a different class it determines at runtime, but could perhaps be able to do it with an auxiliary object like so:

public class Box<T> {
    private T obj;

    public T get() {
        return obj;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions