Class ObjectOnly

java.lang.Object
org.soliscode.test.interfaces.ObjectOnly

public class ObjectOnly extends Object

The ObjectOnly class wraps any object and only exposes the methods on the Object interface. This is used for testing a class or method implementation that operates on an Object without any optimizations for the instantiated class or any other implemented interfaces.

Objects of this class should be created using the Interfaces utility class:

    String s = "a string value";
    Object obj = Interfaces.objectOnly(s);
Since:
1.0
Author:
evanbergstrom
See Also:
  • Constructor Details

    • ObjectOnly

      public ObjectOnly()
      Creates an instance of ObjectOnly. The instance created will wrap the object Integer(0).
    • ObjectOnly

      public ObjectOnly(@NotNull @NotNull ObjectOnly other)
    • ObjectOnly

      public ObjectOnly(@NotNull @NotNull Object obj)
      Creates an ObjectOnly object from any other object.
      Parameters:
      obj - the object whose interface is being restricted.
  • Method Details