/*
 * Copyright 2019, TeamDev. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package io.spine.base;

import io.spine.value.StringTypeValue;

public final class EntityColumn<S extends EntityState> extends StringTypeValue {

    private static final long serialVersionUID = 0L;

    private final Class<S> enclosingMessage;

    public EntityColumn(String value, Class<S> message) {
        super(value);
        this.enclosingMessage = message;
    }

    public String name() {
        return value();
    }

    public Class<S> enclosingMessage() {
        return enclosingMessage;
    }
}

@@ -1041,38 +1041,64 @@
 ort 
-io.spine.value.StringTypeValue
+static com.google.common.base.Preconditions.checkNotNull
 ;%0A%0Ap
@@ -1155,88 +1155,41 @@
 te%3E 
-extends StringTypeValue %7B%0A%0A    private static final long serialVersionUID = 0L;%0A
+%7B%0A%0A    private final String name;
 %0A   
@@ -1212,32 +1212,27 @@
 lass%3CS%3E 
-enclosingM
+m
 essage
+Type
 ;%0A%0A    p
@@ -1257,20 +1257,19 @@
 (String 
-valu
+nam
 e, Class
@@ -1279,16 +1279,20 @@
  message
+Type
 ) %7B%0A    
@@ -1299,61 +1299,92 @@
     
-super(value);%0A        this.enclosingMessage = 
+this.name = checkNotNull(name);%0A        this.messageType = checkNotNull(
 message
+Type)
 ;%0A  
@@ -1434,15 +1434,12 @@
 urn 
-value()
+name
 ;%0A  
@@ -1463,32 +1463,27 @@
 lass%3CS%3E 
-enclosingM
+m
 essage
+Type
 () %7B%0A   
@@ -1498,24 +1498,19 @@
 urn 
-enclosingM
+m
 essage
+Type
 ;%0A  

Make `EntityColumn` no longer implement the `StringTypeValue`