Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
This file is part of Port@l Port@l 3.0 - Portal Engine and Management System Copyright (C) 2010 Isotrol, SA. http://www.isotrol.com Port@l is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Port@l is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Port@l. If not, see <http://www.gnu.org/licenses/>.
 
 
 package com.isotrol.impe3.idx;
 
 
 
 
Task bean

Author(s):
Emilio Escobar Reyero
 
 public class Task {
 	private final long sec;
 	private final String id;
 	private final int type;
 	private final TaskOperation op;

Constructor

Parameters:
sec sec number
id content id
type content type
op operation
 
 	public Task(final long secfinal String idfinal int typefinal TaskOperation op) {
 		this. = sec;
 		this. = id;
 		this. = type;
 		this. = op;
 	}
 
 	public long getSec() {
 		return ;
 	}
 
 	public String getId() {
 		return ;
 	}
 
 	public int getType() {
 		return ;
 	}
 
 	public TaskOperation getOp() {
 		return ;
 	}

Log table row mapper.
 
 	public static final ParameterizedRowMapper<TaskMAPPER = new ParameterizedRowMapper<Task>() {
 		public Task mapRow(ResultSet rsint rowNumthrows SQLException {
 			return new Task(rs.getLong(1), rs.getString(2), rs.getInt(3), .get(rs.getInt(4)));
 		}
 	};

Update online constant.
 
 	public static final TaskOperation UPDATEN = new TaskOperation("UPDATE_N", 0, false);
Delete online constant.
 
 	public static final TaskOperation DELETEN = new TaskOperation("DELETE_N", 1, true);
Update offline constant.
 
 	public static final TaskOperation UPDATEF = new TaskOperation("UPDATE_F", 2, false);
Delete offline constant.
 
 	public static final TaskOperation DELETEF = new TaskOperation("DELETE_F", 3, true);

Map with operations int values.
 
 	private static final ImmutableMap<IntegerTaskOperationOPERATIONS = 
 		.put(0, ).put(1, ).put(2, ).put(3, ).build();

Define an operation.

Author(s):
Emilio Escobar Reyero
	public static final class TaskOperation {
		private final String name;
		private final int id;
		private final boolean del;
		private TaskOperation() {
			throw new AssertionError();
		}
		private TaskOperation(final String namefinal int idfinal boolean del) {
			this. = name;
			this. = id;
			this. = del;
		}
		public int getOrdinal() {
			return ;
		}
		public String getName() {
			return ;
		}
		public boolean isDelOperation() {
			return ;
		}

Retur true if object is an instance of TaskOperation and id and name are the same.

		public boolean equals(Object obj) {
			if (obj == null || !(obj instanceof TaskOperation)) {
				return false;
			}
			return this. == t.id && this..equals(t.name);
		}

Implemented with com.google.common.Objects

		public int hashCode() {
			return Objects.hashCode();
		}
	}
New to GrepCode? Check out our FAQ X