@Test public void equalsTest() throws Exception { MutableInodeDirectory inode1 = MutableInodeDirectory.create(1, 0, "test1", CreateDirectoryContext.defaults()); MutableInodeDirectory inode2 = MutableInodeDirectory.create(1, 0, "test2", CreateDirectoryContext.defaults()); MutableInodeDirectory inode3 = MutableInodeDirectory.create(3, 0, "test3", CreateDirectoryContext.defaults()); Assert.assertTrue(inode1.equals(inode2)); Assert.assertTrue(inode1.equals(inode1)); Assert.assertFalse(inode1.equals(inode3)); }
public static MutableInodeDirectory create(long id, long parentId, String name, CreateDirectoryContext context) { return new MutableInodeDirectory(id) .setParentId(parentId) .setName(name) .setTtl(context.getTtl()) .setTtlAction(context.getTtlAction()) .setOwner(context.getOwner()) .setGroup(context.getGroup()) .setMode(context.getMode().toShort()) .setAcl(context.getAcl()) .setAcl(context.getDefaultAcl()) .setMountPoint(context.isMountPoint()) .setXAttr(context.getXAttr()); }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { public static MutableInodeDirectory create(long id, long parentId, String name, CreateDirectoryContext context) { return new MutableInodeDirectory(id) .setParentId(parentId) .setName(name) .setTtl(context.getTtl()) .setTtlAction(context.getTtlAction()) .setOwner(context.getOwner()) .setGroup(context.getGroup()) .setMode(context.getMode().toShort()) .setAcl(context.getAcl()) .setAcl(context.getDefaultAcl()) .setMountPoint(context.isMountPoint()) .setXAttr(context.getXAttr()); } }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { public static MutableInodeDirectory create(long id, long parentId, String name, CreateDirectoryContext context) { return new MutableInodeDirectory(id) .setParentId(parentId) .setName(name) .setTtl(context.getTtl()) .setTtlAction(context.getTtlAction()) .setOwner(context.getOwner()) .setGroup(context.getGroup()) .setMode(context.getMode().toShort()) .setAcl(context.getAcl()) .setAcl(context.getDefaultAcl()) .setMountPoint(context.isMountPoint()) .setXAttr(context.getXAttr()); } private  MutableInodeDirectory(long id); }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { public static MutableInodeDirectory create(long id, long parentId, String name, CreateDirectoryContext context) { return new MutableInodeDirectory(id) .setParentId(parentId) .setName(name) .setTtl(context.getTtl()) .setTtlAction(context.getTtlAction()) .setOwner(context.getOwner()) .setGroup(context.getGroup()) .setMode(context.getMode().toShort()) .setAcl(context.getAcl()) .setAcl(context.getDefaultAcl()) .setMountPoint(context.isMountPoint()) .setXAttr(context.getXAttr()); } private  MutableInodeDirectory(long id); @Override boolean isMountPoint(); @Override synchronized boolean isDirectChildrenLoaded(); @Override long getChildCount(); @Override DefaultAccessControlList getDefaultACL(); MutableInodeDirectory setMountPoint(boolean mountPoint); synchronized MutableInodeDirectory setDirectChildrenLoaded(boolean directChildrenLoaded); MutableInodeDirectory setChildCount(long childCount); @Override MutableInodeDirectory setDefaultACL(DefaultAccessControlList acl); @Override FileInfo generateClientFileInfo(String path); void updateFromEntry(UpdateInodeDirectoryEntry entry); @Override String toString(); static MutableInodeDirectory fromJournalEntry(InodeDirectoryEntry entry); static MutableInodeDirectory create(long id, long parentId, String name,
      CreateDirectoryContext context); @Override JournalEntry toJournalEntry(); @Override JournalEntry toJournalEntry(String path); @Override InodeMeta.Inode toProto(); static MutableInodeDirectory fromProto(InodeOrBuilder inode); }
MutableInodeDirectory extends MutableInode<MutableInodeDirectory> implements InodeDirectoryView { public static MutableInodeDirectory create(long id, long parentId, String name, CreateDirectoryContext context) { return new MutableInodeDirectory(id) .setParentId(parentId) .setName(name) .setTtl(context.getTtl()) .setTtlAction(context.getTtlAction()) .setOwner(context.getOwner()) .setGroup(context.getGroup()) .setMode(context.getMode().toShort()) .setAcl(context.getAcl()) .setAcl(context.getDefaultAcl()) .setMountPoint(context.isMountPoint()) .setXAttr(context.getXAttr()); } private  MutableInodeDirectory(long id); @Override boolean isMountPoint(); @Override synchronized boolean isDirectChildrenLoaded(); @Override long getChildCount(); @Override DefaultAccessControlList getDefaultACL(); MutableInodeDirectory setMountPoint(boolean mountPoint); synchronized MutableInodeDirectory setDirectChildrenLoaded(boolean directChildrenLoaded); MutableInodeDirectory setChildCount(long childCount); @Override MutableInodeDirectory setDefaultACL(DefaultAccessControlList acl); @Override FileInfo generateClientFileInfo(String path); void updateFromEntry(UpdateInodeDirectoryEntry entry); @Override String toString(); static MutableInodeDirectory fromJournalEntry(InodeDirectoryEntry entry); static MutableInodeDirectory create(long id, long parentId, String name,
      CreateDirectoryContext context); @Override JournalEntry toJournalEntry(); @Override JournalEntry toJournalEntry(String path); @Override InodeMeta.Inode toProto(); static MutableInodeDirectory fromProto(InodeOrBuilder inode);  }