@Test public void serialize() throws IOException { final Operation<Double> object = new Operation<>( "some operation name", 2, (Function<Double[], Double> & Serializable)v -> v[0] + v[1] ); final byte[] data = IO.object.toByteArray(object); @SuppressWarnings("unchecked") final Operation<Double> op = (Operation<Double>)IO.object.fromByteArray(data); Assert.assertEquals(IO.object.fromByteArray(data), object); Assert.assertEquals( op.apply(new Double[]{1.0, 2.0}).doubleValue(), 3.0 ); }
@Override public T apply(final T[] values) { return _function.apply(values); }
Operation implements Op<T>, Serializable { @Override public T apply(final T[] values) { return _function.apply(values); } }
Operation implements Op<T>, Serializable { @Override public T apply(final T[] values) { return _function.apply(values); } Operation(
		final String name,
		final int arity,
		final Function<T[], T> function
	); }
Operation implements Op<T>, Serializable { @Override public T apply(final T[] values) { return _function.apply(values); } Operation(
		final String name,
		final int arity,
		final Function<T[], T> function
	); @Override String name(); @Override int arity(); @Override T apply(final T[] values); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); }
Operation implements Op<T>, Serializable { @Override public T apply(final T[] values) { return _function.apply(values); } Operation(
		final String name,
		final int arity,
		final Function<T[], T> function
	); @Override String name(); @Override int arity(); @Override T apply(final T[] values); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }