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

com.identityx.clientSDK.queryHolders.FidoAAIDStatisticQueryHolder Maven / Gradle / Ivy

There is a newer version: 5.6.0.2
Show newest version
/*
* Copyright Daon.
*
* 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.
*/

package com.identityx.clientSDK.queryHolders;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class FidoAAIDStatisticQueryHolder extends QueryHolder {

	public FidoAAIDStatisticQueryHolder() {
		setSensitiveDataSpec(new SensitiveDataSpec());
	}
	
	public class FidoAAIDStatisticSearchSpec extends SearchSpec {

		private String start;
		private String end;
		
		@JsonIgnore
		public Date getStartDate() throws ParseException {
			return convertString(start);
		}
		@JsonIgnore
		public void setStartDate(Date start) {
			this.start = convertDate(start);
		}
		@JsonIgnore
		public Date getEndDate() throws ParseException {
			return convertString(end);
		}
		@JsonIgnore		
		public void setEndDate(Date end) {
			this.end = convertDate(end);
		}		
		
		public String getStart() {
			return start;
		}
		public void setStart(String start) {
			this.start = start;
		}
		public String getEnd() {
			return end;
		}
		public void setEnd(String end) {
			this.end = end;
		}
		
		protected String convertDate(Date date) {
			TimeZone tz = TimeZone.getTimeZone("UTC");
			DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
			df.setTimeZone(tz);
			return df.format(date);
		}
		
		protected Date convertString(String date) throws ParseException {
			TimeZone tz = TimeZone.getTimeZone("UTC");
			DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
			df.setTimeZone(tz);
			return df.parse(date);
		}

	}
		
	private FidoAAIDStatisticSearchSpec searchSpec = new FidoAAIDStatisticSearchSpec();
	
	@Override
	public FidoAAIDStatisticSearchSpec getSearchSpec() {
		return searchSpec;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy