2012-01-05 00:44:15 +00:00
|
|
|
//
|
|
|
|
// OPElementEntity.m
|
|
|
|
// OnePassword
|
|
|
|
//
|
|
|
|
// Created by Maarten Billemont on 02/01/12.
|
|
|
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "OPElementEntity.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation OPElementEntity
|
|
|
|
|
|
|
|
@dynamic name;
|
2012-01-29 11:41:48 +00:00
|
|
|
@dynamic mpHashHex;
|
2012-01-05 00:44:15 +00:00
|
|
|
@dynamic type;
|
|
|
|
@dynamic uses;
|
|
|
|
@dynamic lastUsed;
|
|
|
|
|
|
|
|
- (void)use {
|
|
|
|
|
|
|
|
++self.uses;
|
|
|
|
self.lastUsed = [[NSDate date] timeIntervalSinceReferenceDate];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)content {
|
|
|
|
|
2012-01-19 16:40:39 +00:00
|
|
|
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Content implementation missing." userInfo:nil];
|
2012-01-05 00:44:15 +00:00
|
|
|
}
|
|
|
|
|
2012-01-29 11:41:48 +00:00
|
|
|
- (NSString *)description {
|
2012-01-05 00:44:15 +00:00
|
|
|
|
|
|
|
return [[self content] description];
|
|
|
|
}
|
|
|
|
|
2012-01-29 11:41:48 +00:00
|
|
|
- (NSString *)debugDescription {
|
|
|
|
|
|
|
|
return [NSString stringWithFormat:@"{%@: name=%@, mpHashHex=%@, type=%d, uses=%d, lastUsed=%@}",
|
|
|
|
NSStringFromClass([self class]), self.name, self.mpHashHex, self.type, self.uses, self.lastUsed];
|
|
|
|
}
|
|
|
|
|
2012-01-05 00:44:15 +00:00
|
|
|
@end
|