All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.geneweaver.domain.Tracked Maven / Gradle / Ivy

/*-
 * 
 * Copyright 2018, 2020  The Jackson Laboratory Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * @author Matthew Gerring
 */
package org.geneweaver.domain;

import java.util.Objects;

import javax.annotation.processing.Generated;

import org.neo4j.ogm.annotation.EndNode;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.RelationshipEntity;
import org.neo4j.ogm.annotation.StartNode;

@Generated("POJO")
@RelationshipEntity(type = "TRACKED")
public class Tracked  extends AbstractEntity {

	/** The gene. */
	@StartNode
	private Track track;
	
	/** The transcript. */
	@EndNode
	private Region region;

	public Tracked() {
		
	}
	
	public Tracked(Region region, Track track) {
		this.region = region;
		this.track = track;
	}

	/**
	 * @return the track
	 */
	public Track getTrack() {
		return track;
	}

	/**
	 * @param track the track to set
	 */
	public void setTrack(Track track) {
		this.track = track;
	}

	/**
	 * @return the region
	 */
	public Region getRegion() {
		return region;
	}

	/**
	 * @param region the region to set
	 */
	public void setRegion(Region region) {
		this.region = region;
	}

	/**
	 * To string.
	 *
	 * @return the string
	 */
	@Override
	public String toString() {
		String tname = track!=null ? track.getName() : null;
		String rname = region!=null ? region.getName() : null;
		return tname+"-[TRACKED]->"+rname;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + Objects.hash(region, track);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (!(obj instanceof Tracked))
			return false;
		Tracked other = (Tracked) obj;
		return Objects.equals(region, other.region) && Objects.equals(track, other.track);
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy