Java Number Min Value minShareLifetime(long shareLifetime1, long shareLifetime2)

Here you can find the source of minShareLifetime(long shareLifetime1, long shareLifetime2)

Description

min Share Lifetime

License

Open Source License

Declaration

private static long minShareLifetime(long shareLifetime1, long shareLifetime2) 

Method Source Code

//package com.java2s;
/*/*from   ww w .ja va2s. com*/
 * ***** BEGIN LICENSE BLOCK *****
 * Zimbra Collaboration Suite Server
 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Synacor, Inc.
 *
 * This program 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,
 * version 2 of the License.
 *
 * This program 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 this program.
 * If not, see <https://www.gnu.org/licenses/>.
 * ***** END LICENSE BLOCK *****
 */

public class Main {
    private static long minShareLifetime(long shareLifetime1, long shareLifetime2) {
        // 0 means there's no limit on lifetime
        if (shareLifetime1 == 0) {
            return shareLifetime2;
        } else if (shareLifetime2 == 0) {
            return shareLifetime1;
        } else {
            return Math.min(shareLifetime1, shareLifetime2);
        }
    }
}

Related

  1. minPos(int a, int b)
  2. minPos(int a, int b)
  3. minPositive(int a, int b)
  4. minPower2(int n)
  5. minRunLength(int n)
  6. minSignedIntForBitSize(final int bitSize)
  7. minSignedIntForBitSize_noCheck(final int bitSize)
  8. minSize(String str, int min, boolean nullCheck)
  9. minSPSForBandCode(String bandCode)