001// Copyright 2022 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007// http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014package org.apache.tapestry5.internal.services;
015
016import java.util.Objects;
017
018/**
019 * Class that holds information about a template for tracking.
020 */
021final public class TemplateTrackingInfo implements ClassNameHolder
022{
023    
024    private String template;
025    private String className;
026    
027    public TemplateTrackingInfo(String template, String className) 
028    {
029        super();
030        this.template = template;
031        this.className = className;
032    }
033    
034    public String getTemplate() 
035    {
036        return template;
037    }
038    
039    public String getClassName() 
040    {
041        return className;
042    }
043    
044    @Override
045    public int hashCode() 
046    {
047        return Objects.hash(className, template);
048    }
049
050    @Override
051    public boolean equals(Object obj) 
052    {
053        if (this == obj) {
054            return true;
055        }
056        if (!(obj instanceof TemplateTrackingInfo)) 
057        {
058            return false;
059        }
060        TemplateTrackingInfo other = (TemplateTrackingInfo) obj;
061        return Objects.equals(className, other.className) && Objects.equals(template, other.template);
062    }
063
064    @Override
065    public String toString() 
066    {
067        return "TemplateTrackingInfo [template=" + template + ", className=" + className + "]";
068    }
069    
070}