You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/03/05 07:52:00 UTC

[isis] branch master updated: ISIS-1897 provide stubs (throwing not implemented) to not break builds

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new b36ba60  ISIS-1897 provide stubs (throwing not implemented) to not break builds
b36ba60 is described below

commit b36ba601aa08eb51a17980fc8bbc9227cf7d0074
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Mar 5 08:51:57 2018 +0100

    ISIS-1897 provide stubs (throwing not implemented) to not break builds
---
 .../applib/internal/exceptions/_Exceptions.java    |  4 ++
 .../apache/isis/applib/util/ObjectContracts.java   | 46 ++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/internal/exceptions/_Exceptions.java b/core/applib/src/main/java/org/apache/isis/applib/internal/exceptions/_Exceptions.java
index 3bed9cb..12e06ca 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/internal/exceptions/_Exceptions.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/internal/exceptions/_Exceptions.java
@@ -71,6 +71,10 @@ public final class _Exceptions {
 		return new IllegalStateException("internal error: code was reached, that is expected unreachable");
 	}	
 	
+	public static IllegalStateException notImplemented() {
+		return new IllegalStateException("internal error: code was reached, that is not implemented yet");
+	}
+	
 	// -- STACKTRACE UTILITITIES
 	
 	public static final Stream<String> streamStacktraceLines(@Nullable Throwable ex, int maxLines) {
diff --git a/core/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java b/core/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java
index 2f1bfb2..67a892a 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/util/ObjectContracts.java
@@ -20,6 +20,8 @@ package org.apache.isis.applib.util;
 
 import java.util.function.Function;
 
+import org.apache.isis.applib.internal.exceptions._Exceptions;
+
 /**
  * Provides fluent composition for Objects' equals, hashCode and toString.
  * 
@@ -76,6 +78,50 @@ public class ObjectContracts {
 	public static <T> Hashing<T> hashing(Function<T, ?> getter) {
 		return Hashing.hashing(getter);
 	}
+	
+	public static interface ObjectContract<T> {
+
+		public int compare(T obj, T other);
+
+		public boolean equals(T obj, Object other);
+
+		public int hashCode(T obj);
+
+		public String toString(T obj);
+		
+	}
+	
+	public static <T> ObjectContract<T> parse(Class<T> target, String propertyNames) {
+		// TODO Auto-generated method stub
+		throw _Exceptions.notImplemented();
+	}
+
+	// -- BACKWARDS COMPATIBILITY
+	
+	@Deprecated
+	public static String toString(Object obj, String propertyNames) {
+		
+		// TODO Auto-generated method stub
+		throw _Exceptions.notImplemented();
+	}
+	
+	@Deprecated
+	public static boolean equals(Object obj, Object other, String propertyNames) {
+		// TODO Auto-generated method stub
+		throw _Exceptions.notImplemented();
+	}
+	
+	@Deprecated
+	public static int hashCode(Object obj, String propertyNames) {
+		// TODO Auto-generated method stub
+		throw _Exceptions.notImplemented();
+	}
+
+	@Deprecated
+	public static <T> int compare(T obj, T other, String propertyNames) {
+		// TODO Auto-generated method stub
+		throw _Exceptions.notImplemented();
+	}
 
 	
 	

-- 
To stop receiving notification emails like this one, please contact
ahuber@apache.org.